-
Greetings All,
Can someone tell me the easiest way to send variables to a .SWF via the URL that opens its HTML page?
For example, let's say I have testflash.swf, which is loaded in an HTML page called testflash.html. The SWF is looking for three variables: firstVar, secondVar, and thirdVar.
Can I send those variables to the SWF when the HTML page is called, i.e.:
testflash.html?firstVar=1&secondVar=2&thirdVar=3
If so, how should my ActionScript look inside the SWF to find and accept these variables?
Thanks for your help.
-
Hi,
actionscript cannot reach the html; you need to use javascript as an intermediary.
In javascript the url parameters are available as location.search - now your javascript should dynamically generate the embedding via document.write() function and add in the url parameters.
When the movie is called with
<embed src="movie.swf?firstVar=xxx" ...
it will have the vars defined on the main timeline
Musicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|