A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Need help using single .swf on multiple .html pages

  1. #1
    Junior Member
    Join Date
    May 2004

    Need help using single .swf on multiple .html pages

    Hi there! I'm new to the board, but it's good to be here.

    I am embedding Flash navigation on multiple .html pages. The navigation needs to incorporate a different background image for each page, and the only way I know how to do this is to create separate .swf files for each page. There HAS to be a better way.

    How can I make the .swf file aware of which .html page it has been loaded into, and display the appropriate image?

    Would a database be useful here?

    Thanks very much for any help, folks.

  2. #2
    Senior Member
    Join Date
    Jul 2003
    Hi, I am in the middle of doing something similar to this, but I have not completed it yet, but I can tell you the approach that I am taking. I am using ColdFusion. The CF page contains a variable specific to that page. The flash file, when it loads it looks for that variable like this...

    myLoadVars = new LoadVars();

    There is a database behind this that the .cfm is reading from.

    I'm sorry I can't be more specific but this should be a good starting place(if you have CF at your disposal.

  3. #3
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Stockholm, Sweden
    No need for database stuff. You just need to add a variable in the html embed code that Flash reads and acts upon.

    There are two places in the html embed code where the swf is mentioned and you add the variable after the name of the swf... like...


    So if you have different background images on frame 1 to 10 for instance you would have framelabels on each of those frames. On the first frame you would have a go to action referencing the variable.


    ...will make your movie go to and stop at the gframe with the framelabel name of red.

    -Pelle Piano
    // Image Gallery
    // Photo Blog

  4. #4
    Junior Member
    Join Date
    May 2004
    Thanks to both of you.

    I don't have ColdFusion, but that sounds like it would work pretty well.

    I had no idea of the trick of controlling a .swf movie from the embed code! That's pretty cool.

    It occurred to me that since the images I am making page-specific are 15-20k each, having all of them in one movie would require some pre-loading, which I'd like to avoid at this point. I've instead created multiple page-specific .swf files that are basically the background images that I load navigation.swf on top of. It seems to be working well so far.

    BUT, pellepiano, your trick will actually solve another problem I hadn't even tackled yet!

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