A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: url based dynamic flash content

  1. #1
    Junior Member
    Join Date
    Dec 2001
    Location
    AL
    Posts
    19
    Hello,

    I've had no problems getting my flash movie to load variables from outside textfiles. Here is my dilema:
    I want to be able to change the url and have the flash update. So for example, if I put in the url:

    http://www.mysite.com/main.php?siteid=testsite

    I want the flash movie embedded in main.php to update and have the variable siteid = "testsite". Does that make sense?

    I can get my flash to update dynamically if I manually edit the variables file, but I'd like to be able to change the content of the variables file from the browser url and have the flash update accordingly.

    Thanks for any help you can give me,
    solid

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    the solution is to have javascript create the html embedding for the movie.
    To start with, location.search is a javascript item that would read ?siteid=testsite in your example.
    Now, where your stndard html page reads
    <object ....><param name=movie value="movie.swf"> .... <embed src="movie.swf" width=....></embed></object>
    do a little edit. Start by putting all that stuff on a long line and then add text in bold
    <script>
    document.write('
    <object ....><param name=movie value="movie.swf'+location.search+'"> .... <embed src="movie.swf'+location.search+'" width=....></embed></object>');
    </script>

    Be sure that the single quotes you add come in matching pairs

    Musicman

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Location
    AL
    Posts
    19
    Is there anything special I need to do inside of my flash movie? I am currently using loadvariables and the name of the file that the flash is embedded in.

    solid

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You don't need to do anything special inside the flash movie if you pass the variables into the movie in this method.

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