I’m having an odd problem and I have to be missing something.
I was creating a MovieClip with Actionscript and pulling an existing Library MovieClip (which only exists in the Library) to the stage. Everything went well and the MovieClip appeared and referenced properly (ie: i could modify height, width, etc). However, when I tried to add a simple listener to the stage I quickly found that though I could modify the properties of the movie, I could not manipulate my new MovieClip’s timeline.
I’ve isolated the code and still can’t manipulate the timeline. In fact, if the MovieClip itself is already playing a default animation, any event to change the frame puts a stop on the animation. So I’m stumped.
Here is the code:
var classRef:Class = getDefinitionByName('mcPlayer') as Class;
var playerLink:MovieClip = new classRef();
var thePlayer:MovieClip = new MovieClip();
thePlayer.addChild(playerLink);
thePlayer.x = 333;
thePlayer.y = 222;
thePlayer.name = 'hmm';
stage.addChild(thePlayer);
stage.addEventListener(Event.ENTER_FRAME,myFunction);
function myFunction(event:Event)
{
thePlayer.nextFrame();
thePlayer.height += 1;
}
The Library Movieclip consists of 3 frames:
Frame 1: plays
Frame 2: plays
Frame 3: gotoAndPlay(1)
Any help would be appreciated. The final line of code is simply to illustrate that thePlayer properties work fine.