Manipulate my flash depending on a URL?
I have a flash map of the UK which is divided up into the counties, a user clicks on a county and is then directed to a new url, eg. www.mydomain.co.uk/region/london
. The flash map remains on that new page in ca开发者_StackOverflow社区se they wish to select a new region.
What I want to know: is it possible to manipulate the flash so that if the url is www.mydomain.co.uk/region/london
then london remains highlighted on the flash map. I presume I will have to use some AS which is fine as long as it is AS3.
I'm not sure how familiar you are with writing your own AS3 scripts. The method I would use in this case is to fetch the URL of your browser, and to parse the location out of it.
See related question: How can my Flash app determine its own URL?
Alternatively you can have the individual county pages pass a variable to the Flash movie in the embed/object tag via the HTML.
A simple way to do it using as3 alone would be to get the URL from the stage's loaderInfo object like so:
Stage.loaderInfo.url
A better but more difficult way to go about it would be to use swfAddress to set up deep linking, history, and other such browser normalities. http://www.asual.com/swfaddress/
精彩评论