|
-
Passing data to flash from html link
Is it possible to have an HTML link that passes data to a swf? I have a lexicon that is made in flash and there are html pages that link to terms in the swf file. I want to be able to add something at the end of the html link that tells the swf what frame to go to.
-
Senior Member
In the <object> and <embed> tags that load the flash movie in the HTML, you can pass variables to the flash movie.
Here's a relevant thread:
Passing Vars to Flash from HTML
-
Thank you for the link, although I don't think that method will work in my scenario. Is there a way of actually putting the variable in the html link itself? The flash page is on a different page than the html page. There would be a hyperlink that would be something like
What is was hoping to do was be able to attach to attach the variable to the link like you can do with php. Something like
Code:
lexicon.html?word=hello
Is that possible?
-
Senior Member
Yes, but you'll need to use either Javascript or server-side scripting, such as PHP.
Here's a page which shows how to parse the query out of location.search in javascript.
http://javascript.about.com/library/...yparselite.htm
Using javascript you do this, and then use document.write to construct custom <object>/<embed> tags that pass on the relevant variables to the flash movie, using the methods described in my previous post.
Also, if you have access to PHP, you can go that route.
Either way, you want to create the <object>/<embed> tags dynamically using information encoded in the URL.
- Jim
Last edited by jbum; 10-08-2004 at 06:59 PM.
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
|