Sunday, July 1, 2012

[Action Script] on mouseclick logic for timeline animation June,2012

So there is a movieclip that goes through certain stages in a Breaking,BrokenLooping,Fixing,brokenPermenant animation cycle

I'm just starting to make the actionscript for it but I'm not sure how to go about it, or if the logic is sound. I am a bit new to actionscript

i assume i can make a function like this
Quote: function myButtonAction(eventObject:MouseEvent) {
trace("you clicked on the button ");
}
myButton.addEventListener(MouseEvent.CLICK, myButtonAction); where myButton is the instance of a button movieclip ontop of the movieclip

__________________________________________________ __________

The general idea is that randomly things will break and stick in a broken loop, then you have to start taping the screen to repair it until fixed or else it permanently breaks

*note that the fixing animation cycle is backwards so that positive on the timeline is it slowly breaking - you tap to reverse frames and "repair"


the logic goes like this (at the start of the looping broken animation)
on user input (mouseclick)
-goto frame (xx) (end of fixing animation)
-stop() for 1 second (stopping so it doesnt just enter next animation cycle)
..... -if user input yes (tap/click)
......... -go back one frame [currentframe -1]
......... -stop() for 0.100 seconds then play()
......... - or if time between taps is less than 0.100, then play
..... -if user input is no (no tap/click)
......... -play()


I'm not sure if that handles all the possibilities but i guess ill find out as i go.

does anyone have any advice on how to start this or if i am missing anything?
on mouseclick logic for timeline animation

Related Post



0 comments: