> you don't need that, it will be availible because its an anon function
> inside another function, therefore all variables inside the containing
> function will be availible.
Right, because of this every MovieClip is sharing the same variables --
which is why it behaves unexpectedly.
That work
it looks like it should work, i would however refactor. in one place you use
the return of attchMovie anotherplace you access the movie via root. have
you go anything else in that movie you are attaching it to, maybe you are
overriding a depth? try getNextHighestDepth instead of handing out depths
you don't need that, it will be availible because its an anon function
inside another function, therefore all variables inside the containing
function will be availible.
put this in frame 1 of a movie to test
function containing ():Void
{
var p:Number = 8;
this.onEnterFrame = function ()
That worked perfectly. Thanks, Geoff.
- MM
you should set riseSpeed inside the newClip, and then apply the
onenterframe to the clip's _y, like this:
newClip.riseSpeed = ((0.03 * hitherYon) - 1.5);
newClip.onEnterFrame = function():Void {
for this part:
newClip.onEnterFrame = function():Void {
newClip._y -= riseSpeed;
};
you should set riseSpeed inside the newClip, and then apply the
onenterframe to the clip's _y, like this:
5 matches
Mail list logo