0

i have tried to research this issue, but being a flash newbie i struggle to wade through the terminology...

i am using the piecemaker 2 slider on the landing page of my BudeStrings Dev Site. the slider contains a total of 5 slides; the first is a movie clip containing multiple frames and the following four are animated text clips consisting of only one frame each.

as per instructions i found on the interwebs, i added a keyframe after last frame of the first (multiframe) clip and added the following code:

dispatchEvent(new Event(Event.COMPLETE));
stop();

to stop the clip looping and to enable the autoplay behaviour of the slider. this works absolutely fine with the first (multiframe) movie clip, but when i try to add the same code to the other four (single frame) clips it does not have the desired effect.

these four clips use the following code:

var myString:String = "Sample text "
var myArray:Array = myString.split("");
addEventListener(Event.ENTER_FRAME, frameLooper);
function frameLooper(event:Event):void {    
if (myArray.length > 0){
TextField.appendText(myArray.shift())­; 
}   
else {  
removeEventListener(Event.ENTER_FRAME, frameLooper);    
}
}

to display some text with an animated typing effect. if i add a keyframe with the dispatchEvent code as i did on the first clip it stops working and when i append the dispatchEvent code to the above actionscript it has no effect, and piecemaker 2 stops autoplaying when it hits slide number 2.

beyond that i have no idea what is causing the problem. please help.

regards, jan

janimal
  • 41
  • 1
  • 2

1 Answers1

0

First of all, you should use the appendText method on a textfield instance, not the class itself (the compiler should give you an error). So if the textfield on your stage is called 'txt' it would become 'txt.appendText..'. Secondly, you should define the event dispatching within the else section as at the time it runs, your animation would be completed.

[edit] make sure you enable strict mode in your publish settings enter image description here

Will Kru
  • 5,164
  • 3
  • 28
  • 41
  • hi. thank you very much for your response. as i said i am a newbie to flash, so forgive me but i don't really understand what you just said...lol. i will spend some time with my good friend google and get to grips with your response as best i can. i can tell you however that the compiler returns no errors and therefore gives me no clues - maybe this relates to the fact that i see the desired product when i export to swf, but the play button on the timeline does nothing. i click it and it just looks unimpressed. – janimal Aug 20 '12 at 07:44