A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: trying to pass swf object parameter in URL

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    528

    trying to pass swf object parameter in URL

    I have a piece of Javascript that creates a Flash file on my site with a swfobject. It uses something like this to read an XML file.

    <script type="text/javascript">
    var so3 = new SWFObject("scroller_x.swf", "scroller1", "100%", "82", "8");
    so3.addVariable("sourceFile", "xmlfiles/myfile.xml");
    so3.addVariable("fileType", "xml");


    </script>

    I have included this page as a php include as it shows on multiple pages. What happens though, is this is an image scroller and is used for navigation. When the users clicks item 10 and goes to that page, the scroller resets. What I want to do is pass along this via URL or on the page

    so3.addVariable("startAt", "10");

    to tell it where to start when the images is selected.

    Thanks in advance.

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    Since it's PHP you can do something like this:
    PHP Code:
    <script type="text/javascript">
    var so3 = new SWFObject("scroller_x.swf", "scroller1", "100%", "82", "8");
    so3.addVariable("sourceFile", "xmlfiles/myfile.xml");
    so3.addVariable("fileType", "xml");
    so3.addVariable("startAt", "<?PHP echo $startAtVariable ?>");
    </script>

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    528
    that's great. Thank you.

    would I just append like

    www.mydomain.com/nextpage?start=5

  4. #4

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