Wednesday 11 May 2011

flash demo



 This is the demo we have just done in flash action script 3.0 create a bubble type shape then create a new layer for a target aka a shape to follow the line we done it in three separate stages layer 2 press f6 on frame 120 then layer 1 go to frame 20 press f6 then move the target a third around the bubble then go to frame 40 press f6 then move the target around a third around again then again the from frame 60 to frame 120 making sure its back in the spot to it started on. This demo is not the easiest to follow convert to a movie clip create new layer in frame 40 put in blank key frame.
 snippet coding movieclickroot (target.x=mathrandom)"620 
moviecliproot(target.y=mathrandom) "250
   var score:Number =0

target.addEventListener(MouseEvent.CLICK, fl_target);

function fl_target(event:MouseEvent):void
{
score +=1
scoreText.text="Score"+String(score)
    trace("SCORE")
}
this bit of coding will count the times numbers of clicks on the target as its moving around the screen then when it gets back to the starting point it reset the score back to zero, 

No comments:

Post a Comment