Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthordarian
    • CommentTimeNov 16th 2006
     permalink
    Okay, for users with flash, I have to load a flash navigation on this project I am doing. Have to. Sorry. Anyways, I want to be able to hilite the active item on the flash movie by setting a query string. I have tried to no avail. Does anyone have experience with this? Help, please!
    • CommentAuthormista3
    • CommentTimeNov 16th 2006 edited
     permalink
    I'd recommend using SWFObject to embed your flash movie on the page:

    "The SWFObject script also comes with an extra function which allows you to pull variable values from the url string. An example is you have a url that looks like this: http://www.example.com/page.html?selectedItem=home . Using the function getQueryParamValue() you can easily pull these values from the url and then pass them into your Flash movie."


    <script type="text/javascript">
    var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
    so.addVariable("selectedItem", getQueryParamValue("selectedItem"));
    so.write("flashcontent");
    </script>


    If you follow the instructions from the SWFObject page, you can then reference these variables directly from the main timeline of your Flash movie as "selectedItem" or from other movieclips using "_root.selectedItem"

    Hope that helps..!
    • CommentAuthordarian
    • CommentTimeNov 16th 2006
     permalink
    Okay, so, once I pass the variable to Flash, can I just use something like this to control it?

    gotoAndStop("_root.variablename");

    or, am I retarded?

    I want to pass a variable with the value of the section name, then have the movie go to the frame with that label. Do I need to do something special?
    • CommentAuthormista3
    • CommentTimeNov 16th 2006
     permalink
    Well if this value matches your frame label exactly I think it'll work, why not give it a shot and see what happens...
    • CommentAuthordarian
    • CommentTimeNov 17th 2006 edited
     permalink
    No, it's not working.

    I put a dynamic text box into my movie just to see if the variable is getting in there, and it is! So, that's all done correctly, but for some reason it's not working when I tell it to go to the frame with that label....

    Well, thank you for the SWFObject advice, i LOVE that! I'll keep looking to see what is wrong elsewhere.

    I know my variable is getting into flash, but, it seems like i can't just say

    gotoAndStop("curSection");

    or even

    gotoAndStop("_root.cursection");

    doesn't work.

    Thanks though.

    UPDATE: Oh hell, I fixed it... I had to put it in as an expression, not a frame label... So, now it works!
    • CommentAuthormista3
    • CommentTimeNov 17th 2006
     permalink
    Great!

    I've just done something similar - but feeding in text content from Wordpress into a Flash movie, will try and write a tutorial about that for my blog I think :)
Add your comments
    Username Password
  • Format comments as (Help)