A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Passing data to flash from html link

Hybrid View

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Posts
    166

    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.

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    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

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    166
    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
    Code:
     lexicon.html
    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?

  4. #4
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center