After this the shape would follow this loop constantly. I then clicked on my shape and added some action script.
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToHide);
function fl_ClickToHide(event:MouseEvent):void
{
trace("HIT")
}
this script above would make it so when you click this shape which is continuously moving around this loop, something could happen but io would need more action script to make that something happen.
Second Lesson
The action script below is to add a scoreing system to a game in flash. Everytime the objes=cct is clicked, the score will increase by 1 point.
var score:Number =0
target.addEventListener(MouseEvent.CLICK, fl_ClickToHide);
function fl_ClickToHide(event:MouseEvent):void
{
score+=1
scoreText.text="SCORE "+String(score)
trace("SCORE")
}
The only problem was that the score would not appear until the object was clicked. To fix this i had to add the line ' scoreText.text="SCORE "+String(score) ' which was used previously and copy it under the variable
Second Lesson
The action script below is to add a scoreing system to a game in flash. Everytime the objes=cct is clicked, the score will increase by 1 point.
var score:Number =0
target.addEventListener(MouseEvent.CLICK, fl_ClickToHide);
function fl_ClickToHide(event:MouseEvent):void
{
score+=1
scoreText.text="SCORE "+String(score)
trace("SCORE")
}
The only problem was that the score would not appear until the object was clicked. To fix this i had to add the line ' scoreText.text="SCORE "+String(score) ' which was used previously and copy it under the variable
No comments:
Post a Comment