Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » [SOLVED] Newbie Question


[SOLVED] Newbie Question

Reply
  #1 (permalink)  
Old 02-18-08, 12:04 PM
ajwagner777 ajwagner777 is offline
New Member
 
Join Date: Feb 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Newbie Question

Here's what I am wanting to do. I have a client provided flash movie file that i will need to start and stop whenever someone mouses over a link. In other words, when someone hovers over a link, I need for the movie to start playing and when they mouse out, i need it to stop.

I have never worked with flash or action scripting before, so any assistance would be greatly appreciated!

Thanks!
Reply With Quote
  #2 (permalink)  
Old 02-19-08, 02:17 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
wow. To be honest that's either going to be ugly or very difficult (i'm talking about the code that should do the trick )

At first sight, there are 2 different approaches: you can either use sockets or you could use a request-based system.

Sockets
what you need to do is create an XMLSocket (a server) in flash, and allow a server-sided client to connect to it whenever he hovers the link on your page. However, html isn't a programming language, and therefor cannot connect to sockets, so you'll be needing a real programming language such as PHP, ASP, Java or .... You'll need AJAX to send a request to a server-sided script (PHP, ASP or JSP = Java Server Pages), which will then connect to the socket telling the movie to begin to play.

This is an enormous amount of code you'll be needing just to make this easy option on your site, so don't start coding this unless you're 100% sure you need this.
Also, using a socket for this is, let's say, a slight overkill: it's like you're using a bazooka to kill a fly

On the other hand: you have a nice piece of work if you can get it to work, and, if you do it right, you'll have a nice piece of code as well

request-based system
This is the ugly way i was talking about, and you'll probably throw this away immediately.

If you use this, you create a sort of "ping"-server in flash, which will send requests to the server on which a server-sided script will be running that will check if the user is hovering the link. If so the movie will start/stop playing.

Why is this ugly: whenever the user desides not to hover over the movie, you're application will be sending thousands and thousands (like every second) of requests to the server asking if he needs to play the movie or not.


Edit:
Or... I totally misunderstood your question, and actually you want to create a flash application to play movies (you allready have a movieplayer, but you need a link inside your flash application to start playing it)...
If so, just have a look at "buttons" or "movieclips" and the onMouseOver and onMouseOut events, triggered whenever you hover on the button/movieclip
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #3 (permalink)  
Old 02-19-08, 03:06 PM
ajwagner777 ajwagner777 is offline
New Member
 
Join Date: Feb 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I think that you understood my question just fine. I am currently working on some alternatives, such as a looping movie that just plays in the background. You opened my eyes to what I incorrectly assumed would be a simple question. I plan on using this forum more and more as I work on different projects.

Thanks for the prompt response!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
General newbie code question Shelby PHP 4 01-14-08 11:00 PM
Hello Another newbie, with a question WannabeCoder New Members & Introductions 0 10-15-06 10:05 PM
Hi - newbie with specific question Seamoose New Members & Introductions 0 04-01-06 07:08 PM
Question from Newbie - ASP & Search Engines mwilliamson ASP 2 08-16-05 12:23 AM
newbie HTML question mrlocom HTML/XHTML/XML 8 04-11-05 12:07 PM


All times are GMT -5. The time now is 06:36 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.