A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: how to make movie start at a given frame from HTML

  1. #1
    Member
    Join Date
    Jul 2004
    Location
    riverside,ca
    Posts
    32

    how to make movie start at a given frame from HTML

    Hi, here is my problem.

    I have created a Home webpage that has a movie for the bannor. the movie plays one time through and ends on frame 10. the bannor remains visible as long as your on the home page.

    Now, when i go to another page, I don't want the bannor to replay. I want it to just display the images from frame 10. I could grate an jpg and place it there, but i was nto wanting to have to do that.

    can i make the same movie start and play on frame 10 from other pages?
    can this code be added to the HTML code?

    thanks

  2. #2

  3. #3
    Member
    Join Date
    Jul 2004
    Location
    riverside,ca
    Posts
    32
    still having problems:
    I added the the following to my Movie....

    if(jump == 1){
    jump = 0;
    page++;
    gotoAndPlay(page);
    }
    stop();


    Then I added these lines of code to the HTML....
    <PARAM NAME=FlashVars VALUE="&jump=1&page=20&" />

    however the whole movie still plays verse starting at page 20

    not sure what i'm doing wrong?

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    You're telling it to start at 20.

    <PARAM NAME=FlashVars VALUE="&jump=1&page=20&" />


    Bob gave you a bunch of ways to load the variables but I think what you are trying to do:

    I want it to just display the images from frame 10. I could grate an jpg and place it there, but i was nto wanting to have to do that.

    can i make the same movie start and play on frame 10 from other pages?
    Doesn't need the count (page++) so it's starting you at frame 21.

    I think you want:

    HTML (test_JumpToPage3.html)

    Line 12 should be:

    <PARAM NAME=FlashVars VALUE="&jump=1&page=page10&" />

    //so you don't use a numbered frame but a named one.


    and frame 1 or 2 of the Koolmoves movie should have:

    if(jump == 1){
    jump = 0;

    gotoAndPlay(page);
    }
    stop();



    This example does exactly that but instead of continuing on from frame 10 it just stops. It's Bob's example movie...it just jumps over the frames to the frame named "page10".

    http://sandbox.blogdns.com/test/test_JumpToPage3.html

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

  6. #6
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    If you're loading flash vars try setting them here...
    <param name="movie" value="bannor.swf?jump=1&page=20" />
    and change the embed
    embed src="bannor.swf?jump=1&page=20"

    [I'll look into making a tute for others.
    And I'll update my earlier vars button tute.]

  7. #7
    Member
    Join Date
    Jul 2004
    Location
    riverside,ca
    Posts
    32
    well, i still can't seem to get it to work right.
    i've attached the Fun and Swf files if someone can help.

    as far as i can tell i did as all have suggested.

    thanks
    Attached Files Attached Files

  8. #8
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    I can't figure out why you just don't make a copy of your banner and dump frames 1 to 9 then insert that into your other pages.
    humanus somes est divinitus in ipsum
    Wiliiam Wallace

  9. #9
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    You are telling it to goto page 12 in the html but only have one named frame called "randall" in that fun file in the zip.

    Change that frames name to "page12" if that's the frame you want to start at .

    Here is you're fun file with it renamed (5.1.7).

    http://sandbox.blogdns.com/fk/bannor.fun

  10. #10
    Cyber-Slacker
    Join Date
    Jan 2001
    Location
    Cape Cod
    Posts
    77
    I'm with you Gusmus. I would just dump all of the other frames and tweens and save the last frame under another name and use that on all of the other pages.

  11. #11
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Quote Originally Posted by rstephens
    well, i still can't seem to get it to work right.
    i've attached the Fun and Swf files if someone can help.

    as far as i can tell i did as all have suggested.

    thanks
    You have many tweens there.
    In this case "page 12" doesn't mean "keyframe 12".
    Each tween is counted as a new frame.

  12. #12
    Member
    Join Date
    Jul 2004
    Location
    riverside,ca
    Posts
    32
    gumus,jamnden... Yes i agree and this would have been the way i would do it. however my navigation menu is also animated and i don't want to keep replaying it on webpage entry. I could just remake the nav, but i was trying to figure another way + learn something new.

    Chris, once again your helping me....thanks. On the differences from my posts to the actual Fun file (randall, page20). I frist tried the page example then i changed the name thinking it might help...on and on.....so the example i sent might have been one of my attempts.

    necromanthus, although my movie is 15+ frames...i understand that it will be longer with the tweens. in one of my post as you'll thats why i had page 20 verse page 10.

    to all....thanks for your help

  13. #13
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Since the site must not be a full flash site if you are worried that the banner restarts, the old portal trick might be a solution too.

    Create a 2 frame frameset with the banner in the upper frame and the pages pulled into the lower frame. When your users enter the banner starts as normal but as they change pages it does not affect the banner at all. If you use no border for the frameset it would be invisible to the end user and seamless.

    Don't like framesets? Use 2 iFrames.

  14. #14
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Quote Originally Posted by rstephens
    necromanthus, although my movie is 15+ frames...i understand that it will be longer with the tweens. in one of my post as you'll thats why i had page 20 verse page 10.
    You missed the point.
    Each page of your movie has 59 frames (!?!).
    In this case <PARAM NAME=FlashVars VALUE="&jump=1&page=20&" /> it means
    gotoAndPlay("the first page")

  15. #15
    Member
    Join Date
    Jul 2004
    Location
    riverside,ca
    Posts
    32
    Necromanthus, ok i hear you now. is it simple math then to just to multiply 59 X (the frame) i want to start at?

  16. #16
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    well you can but you really should just name your keyframes that you want to jump to and then use the name in the gotoAndPlay gotoAndStop commands.

    I'm adding a tutorial explaining keyframes/frames in KM see other thread

  17. #17
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Quote Originally Posted by rstephens
    Necromanthus, ok i hear you now. is it simple math then to just to multiply 59 X (the frame) i want to start at?
    Is not so simple as it looks.
    Also you did 2 mistakes there:
    1) The ActionScript for the first keyframe is the following:
    Code:
    if(jump == 1){
    	jump = 0;
    	pag = eval("page");
    	pag++;
    	pag--;
    	gotoAndPlay(pag);
    }
    stop();
    This trick is useful to convert a text number into a real number.
    Otherwise, in certain conditions FlashPlayer may jump to strange locations.

    2) Also pay attention to the HTML code:
    ... WIDTH="760" HEIGHT="84" id="bannor" ALIGN="middle">
    <PARAM NAME=movie VALUE="bannor.swf" />
    <PARAM NAME=FlashVars VALUE="&jump=1&page=12&" />
    ... <EMBED src="bannor.swf" bgcolor="#000000" WIDTH="760" HEIGHT="84" FlashVars="&jump=1&page=12&" ...

    As general rules:
    - Do NOT use tweens for ActionScript keyframes
    - If you're looking for smooth movement on entry-level machines, do NOT use labeled keyframes (because of the indexing method, the movie runs much slower)

    That's all.

  18. #18
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Quote Originally Posted by necromanthus
    - If you're looking for smooth movement on entry-level machines, do NOT use labeled keyframes (because of the indexing method, the movie runs much slower)

    That's all.
    That's a shame but it's the way I reccomend those with low end machines will have to just suffer in my opinion, It's just not practicle to not use lables. Of course I only use labels when "Jumping" to frames not for keyframing.

  19. #19
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Quote Originally Posted by blanius
    It's just not practicle to not use lables.
    Labeled keyframes are useful for lazy folks (LOL) and/or for short "artwork" movies (movies without sophisticated AS routines).
    In case of movies with hundreds/thousands of frames containing multi-loops, if the global performance is "a must", DON'T use labeled keyframes !
    cheers.

  20. #20
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Goto frame actions with labelled frames are translated on export into goto frame frame actions with correct frame numbers. KoolMoves counts all the key frames and tweens associated with the frame label and uses that number for the goto action. It isn't necessary to label every frame. Just the frames that are associated with goto frame actions. Using labelled frames shields you against the problem of using absolute frame numbers if you move frames around, insert frames, etc.

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