A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Javascript to control flash navigation?

  1. #1
    FK Photoshop Slut rugbystud's Avatar
    Join Date
    Jul 2000
    Location
    Too drunk to remember...
    Posts
    3,537

    Javascript to control flash navigation?

    Check this site. http://www.heaveninyourhands.com/mental_health/

    If you have a look at different pages, you can see the flash navigation bar at the top has to load in every time a new HTML page is loaded. I was wondering if there was a way that if the user went back to a page they had already seen the flash nav (alerady cached) would just go straight to the last frame of animation.

    ANy ideas ppl? Need you help here

  2. #2
    Junior Member
    Join Date
    Oct 2000
    Posts
    2
    Easiest way would probably be to have 2 index pages. Say "index.htm" and "index2.htm". The first page would be exactly as it is- including the header animation. In the 2nd page, add a variable to your SWF- like "flashmovie.swf?anim=1". This value will be passed into your Flash movie. In the Flash movie, before the animation begins, check for this value. If anim==1, go to the last frame. Adding this variable value would of course need to be done to the rest of your html files. That way, only the index.htm page displays the animation.

    Hope this simple method works for you.

  3. #3
    they call me the_jump... le_saut's Avatar
    Join Date
    Mar 2001
    Posts
    536

    cookie

    Cookie the user, then check for the cookie. Add some variables to the movie name ...to be passed into the movie on load up...in the object and embed tags.
    Code:
    src="movie.swf?cookie=1"//if cookie present
    src="movie.swf?cookie=0"//if not
    //this can be done with js or php or whatever.
    in actionscript
    Code:
    if(_root.cookie==1)
    {
    gotoAndStop("lastFrame");
    }
    else
    {
    play();
    }
    This is a pretty cool way of getting info into a flash movie without using loadVariables etc... good for bookmarking flash movies as well.
    It's not a relatively well known thing either.

    Downside
    1.User can clear cache then reload with the cookie present, then you are stuffed.
    2.User can ban cookies, in which case no enchilada...


    HTH
    James
    Last edited by le_saut; 10-07-2002 at 07:48 AM.

  4. #4
    proud new daddy! LuxFX's Avatar
    Join Date
    May 2000
    Location
    Dunsinane
    Posts
    1,148
    check out this Scripting With Flash to get some info on controlling the flash movie from javascript.
    For War's a banker, flesh his gold. There by the furnace of Troy's field, Where thrust meets thrust, he sits to hold His scale, and watch the spear-point sway; And back to waiting homes he sends Slag from the ore, a little dust To drain hot tears from hearts of friends

    - Aeschylus, Agamemnon

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