Added: 2 years ago
From: alonzohosford
Views: 12,973
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (28)

Sign In or Sign Up now to post a comment!
  • Great to hear. Only comment I was going to have is to be sure the button code is on the frame where the buttons are located. But it seems u figured it out.

  • Oh, I'm an idiot, taken me so long to realise my stupid mistakes.

    This is perfect thankyou.

  • First animation is on frame 1 to where it ends. One more frame has the moon as a button and a stop action. Next frame but I recommend a second layer has the reverse animation with again one additional frame that would have the sun as the button and a stop action. The button moon would say gotoAndPlay (frame number were sun going down animation starts). The button sun would gotoAndPlay (frame where the sun going up starts).

  • @lonhosford ok, could you help with my code?

    sun_btn.addEventListener(Mouse­Event.CLICK, sun_btn_onMouseClick);

    function sun_btn_onMouseClick(e:MouseEv­ent):void

    { play(); stop(); gotoAndPlay(sun_btn); where sun_btn = 1 gotoAndStop(sun_btn); where sun_btn = 35

    }

    moon_btn.addEventListener(Mous­eEvent.CLICK, moon_btn_onMouseClick);

    function moon_btn_onMouseClick(e:MouseE­vent):void

    { play(); stop(); gotoAndPlay(moon_btn); where moon_btn = 35 gotoAndStop(moon_btn); where moon_btn = 70

    }

  • @swedenips thankyou so very much for your help by the way, I ran out of characters.

  • To payback in reverse, you need to use the menus to duplicated the tween and then the menus to reverse the tween. Then you can simply use the actionscript seen in this video.

  • @lonhosford what I'm doing is creating a day and night scene, so when you click the sun, it will set and the moon will rise. I want it to stop there once that's played, and then when you click the moon it will reverse.

    I think I have to change something?

  • I downloaded the file for this, but I want to know how to use the second half of it which lists 'gotoandstop' as I need my animation to play to a certain frame and then play back again in reverse when clicked.

    I can't find a video that teaches how to use the 'gotoandstop/play' parts?

  • You will need to create movie clips for each tween. Then one will loop and the other will have a stop action. Actionscript applies to a single timeline and the stage is a single timeline and each movieclip is a single timeline.

  • Does anyone know how to stop a specific motion tween while another keeps looping?

  • thanks a lot! great help :D

  • hi there this is Oscar would you please send me your codes so that i can just copy and paste please

  • On creating multiple layers for interactive Flash CS4. Do you have to write the code for each layer? Or can you write the code on one layer, and will that control the other layers?

  • here my error I get

    1120: Access of undefined property play_button.play_button.addEve­ntListener(MouseEvent.CLICK, play_button_onMouseClick)

  • Comment removed

  • I didn't know Kevin Spacey does tutorials. Anyway thanks! :D

  • hey i have a question i just want to repeat the motion tween that i did and i want to continuesly playing this motiontween. how to add this in action script?

  • No Actionscript is required. Flash automatically repeats a timeline unless you explicitly add Actionscript to stop it. Perhaps you are still using the IDE Control Play which is a testing play that does stop a tween and designed for checking a timeline without running actionscript or publishing the movie. Once you publish the movie or use Control Test Movie which publishes the movie you see the tweens as they would be played in the final movie.

  • I wish I had time for that. It would require a whole series.

    I recommend you go to my web site Adobe book store and look at the book ActionScript 3.0 Game Programming University. U will learn a lot about Actionscript u will need for gaming as well as gaming

    alonzohosford.

    com

    ?

    page

    =

    adobe_store

  • I may have accidentally deleted this comment from meggles48

    Do you think you could do a tutorial on building a game using ActionScript? I have a game that I would like to put together, but I'm not very good with the ActionScript. It involves a mix of soccer, football, and Frisbee. Could I send you a layout of the game?

  • You lost me with the cutting and pasting of the template which I don't have access to. How are we suppose to access that file? I went to your website and cannot see where to access them other than buy your book on Amazon.

  • I have no books on Amazon and there are no templates.

    Some videos have starter exercises and I mention them at start of video if they exist.

    You can go to my web site alonzohosford dot com and you will find support files to exercises.

  • Just type the first few lines yourself to ex. stop();

  • hello. can you please send me the actionscript you used for the buttons. it would be very much appreciated.

  • Type in the script to the play and stop examples on your own. Type what you are comfortable doing. I added some of the comments, just so I could follow along better. It works like a charm!

  • very well organized video tutorial, it really helps you learn.

    thank you.

  • Comment removed

  • wow thx this helped me a lot getting started making flash.....but i had only one problem with it. It seems when i try to use the play and pause buttons i created they seem the disappear after frame one unlike yours. If you could drop me an email or message helping me with this problem that would be great. Thx again for making these great videos.

  • Extend the button keyframe by right clicking on the last frame of the layer and selection "Insert Frame". The button layer is a static frame covering all frames of the animation layers.

  • Also save your Movie!! LoL....

    5/5 Great Great Tutorial

    Thank you

  • Thanks for the kind words. Glad they helped. More will come with time.

  • Thank You so much guy, I agree with the person below, your the ONLY sane video tutorial I've come across, Thank You again

  • i gotta tell you... ive been looking for a vid like this for a while, not some little kid speeking heavily into a mic but a well put together tutorial on AS3, thank you so much you have just saved part of my Final Grade in my Intro to AS3 class :) 5/5

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more