Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts

    goto frame using URL query (Flash)

    I'm making a flash nav that uses a query string to decide what page is being displayed and in turn displays the related frame.
    The basic actionscript I'm using is this:
    Code:
    if (_root.page=news){
    	gotoAndStop("news");
    }
    and the HTML that's passing the query string is this:
    Code:
    <object type="application/x-shockwave-flash" data="nav_master.swf?page=news" width="600" height="200">
    <param name="movie" value="nav_master.swf?page=news" />
    </object>
    Now, that should work, as the frame that the AS is pointing to is labelled "news". I've also tried it with the frame number instead, but that didn't work.
    Can anyone see what I'm doing wrong here? Any ideas?

    I take no responsibility for the above nonsense.


    Left Justified

  • #2
    New Coder
    Join Date
    Nov 2003
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this works, but uses frame numbers instead of labels:

    http://www.jmparsons.com/goto/exampleframe1.html

    http://www.jmparsons.com/goto/exampleframe20.html

    http://www.jmparsons.com/goto/exampleframe40.html

    all the same swf.

    view source for frame 20 example, its all done with dreamweaver.

    hope that can help.
    Last edited by lejon; 04-10-2004 at 09:17 AM.

  • #3
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that lejon
    I knew about the dreamweaver/javascript method, but Iknew it had to be more simple than that, and I wanted to rely on as few technologies as possible. (even though not many people would surf with Flash and without JS...)

    All i needed to change was my syntax in the actionscript.
    Here's the corrected code if anyone in the future stumbles across the post with a similar problem.
    Code:
    <!-- passing the query string via html -->
    <object type="application/x-shockwave-flash" data="nav_master.swf?page=news" width="600" height="200">
    <param name="movie" value="nav_master.swf?page=news" />
    </object>
    
    //Actionscript
    if (_root.page=="news"){
    	gotoAndStop("news");
    //Goes to a frame labelled "news"
    }

    I take no responsibility for the above nonsense.


    Left Justified

  • #4
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Update: Keeping with tradition, the simple method I posted above doesn't work in IE...
    And, in keeping with their tradition, Dreamweaver's version only works in IE...
    So, I've had to combine the two to get some decent browser support.
    I feel used

    I take no responsibility for the above nonsense.


    Left Justified

  • #5
    New to the CF scene
    Join Date
    Sep 2009
    Location
    Dublin
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple goto label solution

    mindlessLemming

    You are an absolute star. I joined the forums to say thanks and to share my solution.
    I've been searching for a couple of days (and kept getting back to the same sites) for a way to link from each slide in a xml driven project gallery slideshow (thanks Kirupa.com) to a frame showing a different slideshow

    Anyway I worked out from mindlessLemming post that all I had to do was add the following to my actionscript

    myButton.onRelease = function() {
    gotoframelabel();
    };

    function gotoframelabel() {
    if (desc_txt.text=="Kresge"){
    gotoAndStop("Kresge");
    }
    };


    where desc_txt is the name of my Dynamic Text Box and Kresge is text coming from my XML - see below, AND the frame label



    MY XML
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
    <pic>
    <image>images/03.jpg</image>
    <caption>Kresge</caption>
    <thumbnail>images/50p_a.jpg</thumbnail>
    </pic>
    <pic>
    <image>images/04.jpg</image>
    <caption>Different Caption</caption>
    <thumbnail>images/50p_b.jpg</thumbnail>
    </pic>
    </images>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •