Monday, March 29, 2010

actionscript movement corrupt the...

Hi all.

I have a MoveiClip in my stage, I use actionscript to move it
to some other position.

It works great.

But in some frames later I inserted a keyframe and I used the
same movieclip for a motion tween. but this motion tween is not
considered at all.

what's the problem.... how should I fix it ?!



the main goal of doing such a thing is below :

I'm doing a game, in the desired movieclip there are some
other of movieclips which will be visible / invisible due to some
conditions.

after finishing the game I want the same MovieClip ( with
exactly the same properties of visible / invisible internal
movieclips) to start a motion tween, but It doesn't start the
motion.



here is a sample file which I made :

www.parspake.com/majid/flash/TEST.fla



Any idea would be help me very much



regards



actionscript movement corrupt the...
Hi



You can simply put the tes_mc tween in a other movieclip we
call it tesHolder_mc

Then you move the tesHolder_mc with actionscript



//Olofactionscript movement corrupt the...
Dear Olof

I did such a thing ...

the problem is , all my movements are not with actionscript.

I have to move the movieclip sometimes with motion tween. and
exactly here is the problem

as you see in the sample fla file, I user some actionscripts
to move the movieclip to a specific position, then I used motion
tweeining to move it . but all the motion tweenings are discarded.








Is it considered as a BUG of flash or what ?!
It usually helps to isolate the problem, and trying to
replicate it to narrow the scope. I think I might have had a
similar problem before.



But try and make a new FLA file. In it you place the object
you are trying to animate. Dont have ANYTHING else in the FLA file.
And on the first frame try and animating it with ActionScript. When
that animation is done make the movie jump to a new frame where the
same graphic is, and try a simple frame tween. See if you have the
same problem. Then you have narrowed the scope and you have
replicated the problem. Now work on this file until you have fixed
it. This way you dont get bogged down with all the other code in
your original file and distracted by other things. I would try and
rename the movieclip where you need to animate it by hand. Maybe
even a new layer. Anything to remove it from memory from when it
was animated by code.



AKIRA
This may not need to be said (the obvious), but:



When you placed the new instance of the same movie clip on
the stage, did you also give it an instance name? All elements on
stage controlled with actionscript must have an instance name that
is referred to by the script.



-john
Thanks for your response

The main problem is that I don't want to place a new instance
of that movieclip.

I know it will be solved if I place a new instance in a new
layer

the problem is that I have a car in my game which will be
damaged by hitting some obstacles, and cause a damage to car (which
will be setting a child movieclip in car_mc to be visible), finally
II want to show the same car ( with same damages) in a motion
tween.

The problem is I want to somehow save the child movieclips
visibility status.

The sample file is the key for solving such a thing :)



good luck

majid
  • scar cream
  • No comments:

    Post a Comment