Results 1 to 10 of 10

Thread: Play the next 15 frames and then gotoAndPlay

  1. #1
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Play the next 15 frames and then gotoAndPlay

    I have a rough Flash photo gallery that I'm designing with a "curtain" that opens and closes when each larger image is displayed.

    My question is, how do I make my thumbnail buttons in there movie clip make my other movie clip with the large images play the next 15 frames before moving on to gotoAndPlay another frame in that same movie clip?

    The playing of the 15 frames before moving on is the issue.

    Thanks in advance for any help.

  2. #2
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    245
    Thanks
    39
    Thanked 24 Times in 24 Posts

    Default What version?

    Are you using ActionScript 3.0 and _____.addEventListener(event:TYPE.function); methodology?

    It is hard to visualize what you are doing without seeing your code. You could open MovieExporer panel and copy the code.

    I'm guessing a named instance of a MoviClip symbol could be loaded that plays (or gotoAndPlay(frame)) for 15 frames. Maybe you could use a Timer?

  3. #3
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    auntnini, thanks for the reply, I'm using AS2.

    I thought of using a timer but that would be hit and miss for accuracy.

    my actionscript is:

    Code:
    on(Release){
    	photosMC.gotoAndPlay("img12");
    }
    The actionscript is on a button inside the movie clip "Master clip MC" and when it is clicked on it needs to first figure out what frame the movie clip "photosMC" is stopped at and then advance it 15 frames and then go to the frame named "img12" in the same timeline. This must be possible but if it's too complex I will have to try another way.

    Thank You.

  4. #4
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The more I think about it a timer wouldn't work at all.

  5. #5
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    245
    Thanks
    39
    Thanked 24 Times in 24 Posts

    Default code on button

    Old way of putting code on object on Stage is what is called AS 1.0 and is permitted by what they call AS 2.0.

    I'm currently using OOPy ActionScript 3.0 (which is not backwards compatible and in which I could use something like currentFrame+15). Why 15 frames? I'll have to think about this and do some research but don't have time at the moment. In the meantime, if I can locate my old FLA, would something like http://peterbloch.tripod.com or http://www.ppbloch.com/flash/index.htm (done in AS 2.0?) work?

    I'm trying to visualize your project. You can address named instances of button and movie clip symbols with ActionScript; but a graphics symbol instance runs the exact number of frames in main timelilne as the symbol. Would using a graphics symbol solve your problem?

    Then in 15th frame; on(ENTERFRAME) {gotoAndPlay(frame); } (I have to check syntax)

  6. #6
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    nextFrame();
    Can this be coded to make it play the next 15 frames instead of just advancing one?

    Thanks.

  7. #7
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    245
    Thanks
    39
    Thanked 24 Times in 24 Posts

    Default

    If I recall correctly -- at http://lineforhire.tripod.com/flash/index.html --- I just had content for a number of frames and, in last frame, loaded a new movie of just went to a frame number or label-name. You have gotoAndPlay( and gotoAndStop().

    The nextFrame() or prevFrame() just brings you to a certain frame number or label-name. Then have number of frames at that spot that you want to play.

    Are you using anonymous functions in Timeline and named symbol instances?

  8. #8
    Join Date
    Mar 2010
    Location
    Wisconsin
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The nextFrame(); brings you to the next frame without using frame names or numbers and that does work for me but how do I then make it play the next 14 frames?

    I cannot target a frame number or name because I have multiple thumbnails and when one is clicked on I want the next 15 frames of the larger image that is already being displayed to close while it's being displayed and then open another large image that I have targeted by frame name.

    This is what I need to do but of course it is not correct:

    Code:
    photosMC.play(next15frames);
    stop();
    photosMC.gotoAndPlay("img12");
    I hope this helps explain things a litle more.

    Thank You.

  9. #9
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    245
    Thanks
    39
    Thanked 24 Times in 24 Posts

    Default step 1

    This is old -- using ActionScript2 with script in Timelline ananymous functions.

    I'm going to have to do this in steps to use screen shots of code in Movie Explorer, etc.. This is from http://www.auntnini.com/vectorFlash/index.html where there is an opener MC.

    Then each movie clip is played by buttons. Each MC has its own Timeline and plays a certain number of frames. There is a stop(); in last frame.

    Here is "Audrey" MC Timeline for example.

  10. #10
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    245
    Thanks
    39
    Thanked 24 Times in 24 Posts

    Default Basics

    The default behavior of Flash is to PLAY movie -- starting from frame 1 of scene 1, continuing to subsequent frames in subsequent scenes -- and looping back to PLAY entire movie again and again. So the objective seems to be: where, when, how to STOP, alter, or redirect the default PLAY behavior of Flash.

    Flash is event driven. Events that can trigger a script occur when playhead reaches a frame, when movie clip loads or unloads, or when user clicks a button or presses a key on keyboard. ActionScript scripts tell Flash what action to perform when event occurs.

    It's hard to visualize how the curtain opens/closes. If the curtain is imposed on top of large images, it might have to be incorporated into individual movie clips. (The sort of thing done with animated masks or tweens.)

    MovieClip symbol instances can be placed in one frame of main Timeline. In the referenced old AS2.0 http://www.auntnini.com/vectorFlash/index.html each item is a MovieClip that plays out its own Timeline with a stop(); action in last frame (could have been gotoAndStop(1); to rewind). Code on the buttons -- on (release) { gotoAndStop("2"); } -- refer to labeled frames for each MovieClip, which play out their own Timeline.

    Here's the MovieExplorer description of FLA actions for playing the MovieClips:

    Code:
    Actions for Frame 1 [actions layer]
    	/* stop(); in setInterval layer */ 
    	//stop(); 
    	this._lockroot = true;
    
    	onEnterFrame = function() {
       	_root.statusField = _root._currentFrame + " of " + _root._totalFrames; 	}
    	next_btn.onPress = function() { nextFrame(); }
    	prev_btn.onPress = function() { prevFrame(); }
    
    /* draw_btn.onPress = function() { this.loadMovie("drawCircles.swf", "loader_mc"); }; */
    
    Actions for Frame 1 [setInterval layer]
    	stop();
    
    /* onEnterFrame = function() { myInterval = setInterval("nextFrame", 90000); } */
    
    Actions for Frame 2
    	//stop();
    	//setInterval("nextFrame", 90000);
    
    arrow_btn, ‹prev_btn›
    arrow_btn, ‹next_btn›
    frameNum_btn, ‹frame1_btn›
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("1"); }
    frameNum_btn, ‹frame2_btn›
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("2"); }
    frameNum_btn, ‹frame3_btn›
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("3"); }
    frameNum_btn, ‹frame4_btn›
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("4"); }
    frameNum_btn, ‹frame5_btn› 
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("5"); }
    frameNum_btn, ‹frame6_btn›
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("6"); }
    frameNum_btn, ‹frame6_btn›
    	Actions for frameNum_btn
    		on (release) { gotoAndStop("7"); }
    
    (empty), (statusField), ‹status_txt›
    
    	Actions for Frame 1
    		/* loadMovie("../MSNpics/selfPortrait.jpg", loader_mc); */
    
    usaFlag
    finalAll
    wolf
    moyaJawMove
    catWagTail
    audrey
    male
    
    circleBUTTON, ‹draw_btn›
    	Actions for circleBUTTON
    		on (press) { loadMovieNum("drawCircles.swf",0); }
    
    DrawCircles, (GoudyOldStyleT-Bold, 18 pts)
    whiteBox, ‹loader_mc›
    And here's the starter section which loads that movie:

    Code:
    
    Actions for Frame 1
    	_level0.dummy_mc.content._lockroot = true;
    	_root.onEnterFrame = function() {
    		loadMovieNum("preloader.swf", 4);
    		load_text = Math.round((getBytes.Loaded() / getBytesTotal())*100) + " % Loaded"; }; 
    /*var percent:Number = Math.round(_level0.dummy_mc.getBytesLoaded() / _level0.dummy_mc.getBytesTotal())*100;_level0.load_text = (percent) = " % loaded"; */
    	start_btn.onPress = function() {
    		_root.loadMovieNum("preloader.swf", 4); 
    		_root.loadMovie("slideLoad.swf", "dummy_mc"); };
    
    	_level0.onEnterFrame = function() {
    		if (_level0.dummy_mc._framesloaded == _level0.dummyr_mc._totalframes) {
    		unloadMovieNum(4);
    		_level0.load_txt._visible = false; 	}
    	};
    
    	stop_btn.onPress = function() {
    		unloadMovieNum(4);
    		unloadMovie("dummy_mc"); };
    
    	draw_btn.onPress = function() {
    		_root.loadMovie("drawCircles.swf", "dummy_mc"); };
    
    Actions for Frame 5
    	stop();
    
    loaderMC, ‹loader_mc›
    Loader, ‹dummy_mc›
    circleBUTTON, ‹start_btn›
    circleBUTTON, ‹stop_btn›
    circleBUTTON, ‹draw_btn›
    (empty), (loadText), ‹load_txt›

Bookmarks

Posting Permissions

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