views:

29

answers:

2

Like the title say's, is it possible to send data to my flash movie after it has been loaded?

More specific: I have a flash-movie with an image in it, and from the outside I would like to be able to alter it by sending fe. '?color=FF00FF' to the movie.

Is there a way to catch this variable in flash?

+1  A: 

Yes. Investigate the flash.external.ExternalInterface class.

Robusto
Thank you, this was the exact thing I was looking for.
kuipersb
A: 

Yes, you can, there are a few possibilities though depending on how you want to input that variable. If you use Javascript, check the ExternalInterface class that allows for communication between JS & AS3 , but you could also send variables via your url. What would your input method be?

PatrickS
I would prefer using the url, if possible. How would I go about this if the flash-movie is already running? I am using jQuery at the moment for sending data to PHP via $.get() is something similar possible for the flash-movie?
kuipersb
check this article: http://www.permadi.com/tutorial/flashQueryString/
PatrickS
Thank you, but it does not seem to react to changes in the url, or src="" attributes in the html(Firebug), without reloading the page. So I think the ExternalInterface class would be the better option.
kuipersb
yes, if you change the url , flash will reload. it all depends on what you're trying to do. ExternalInterface will work well without reload.
PatrickS