Keith,
added [index] to the function;
now have the following error:
1120:Access of undefined property index.

Wish I could wrap my head around this. Any thoughts?

On May 11, 2010, at 7:31 PM, Keith Reinfeld wrote:

gotoAndPlay(mOnemTwo);

You need to pass just one element of the mOnemTwo array rather than the
entire array.
So:

gotoAndPlay(mOnemTwo[index]);

Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-
boun...@chattyfig.figleaf.com] On Behalf Of Donald Talcott
Sent: Tuesday, May 11, 2010 5:25 PM
To: Flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] gotoAndPlay a sorted array

Have a file with 9 animations, each with a frame label on the timeline
I've created 2 arrays, sorted the 2nd one and concat() the two into a
third array.
I'm tracing all arrays and they are working as I'd like. Now I would
like to gotoAndPlay the final array.
Can this be done? See code below:

stop();
var mOne:Array = ["mmPretzel", "3Musketeers_truffle"];
var mTwo:Array = ["MilkyWay_Caramel", "mmCO", "mmCherry", "Twix_java",
"VOTE", "mmPB", "NASCAR"];


function shuffle(mTwo,b):int {
var num : int = Math.round(Math.random()*2)-1;
return num;
}
var b:Array = mTwo.sort(shuffle);
trace(b);

var mOnemTwo:Array = mOne.concat(b);
trace(mOnemTwo);




/*function goOn(){
gotoAndPlay(mOnemTwo);
};
setTimeout(goOn,+8);
*/


When I uncomment the function, I get the following error.

mmCherry,mmPB,mmCO,MilkyWay_Caramel,VOTE,Twix_java,NASCAR
mmPretzel, 3Musketeers_truffle,mmCherry,mmPB,mmCO,MilkyWay_Caramel,VOTE,
Twix_java,NASCAR

ArgumentError: Error #2109: Frame label
mmPretzel, 3Musketeers_truffle,mmCherry,mmPB,mmCO,MilkyWay_Caramel,VOTE,
Twix_java,NASCAR not found in scene Scene 1.
        at flash.display::MovieClip/gotoAndPlay()
        at Mars_2010Test_fla::MainTimeline/goOn()
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at SetIntervalTimer/onTimer()
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()

Don Talcott
316 Greenwood Ave
Decatur, GA 30030
404 538-1642
dtalc...@mindspring.com



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to