hi, im just starting to learn some action script in flash mx…and im a bit stumped and i was wondering if i could get some help.
I have this bit of code on the movie clip of a bird
onClipEvent(load)
{
this._x = Math.round(random(400));
this._y = Math.round(random(300));
this._xscale = random(100)+60;
this._yscale = random(100)+60;
}
onClipEvent(enterFrame)
{
if(this, hitTest(_root.Aim))
{
_root.Aim._rotation = -22.5;
_root.txtStatus = "hit!"
this._alpha = 20;
}
else
{
_root.txtStatus = "miss!";
}
}
Aim - is just a custom cursor i drew
txtStatus - a dynamic text box
my aim was very simple, to duplicate several copies of the movie clip 'Bird" and get the text box to show ‘hit’ when the cursor is over the bird and ‘miss’ when the cursor is anywhere other than over the bird(s).
the thing i’m confused about is ALL the copies of ‘Bird’ respond to the ‘alpha’ change, but only the original* will respond to the change of text. And as for the rotation, i have in the Aim cursor this._rotation += 22.5, so i thought, well, if i minus 22.5 it will make the cursor ‘upright’ (or no rotation), this worked for the copies, but as for the original* it is ‘tilted’ by 22.5 degrees (to the left).
[size=1]**i’m quite sure its the original - even though i placed the original off stage, it still seems to appear when i play the movie.*[/size]
[size=1]
[/size]
i can’t seem to find any errors in my coding/syntax, and what i don’t understand is why the copies respond differently (or don’t respond at all) to each command.
any help would be greatly appreciated!
pyko