FORUMS: list search recent posts

[AS2] is there a way to call ALL movie clips with an onRelease?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dan Flynn
[AS2] is there a way to call ALL movie clips with an onRelease?
on May 16, 2009 at 9:20:18 pm


Basically i'm just looking for a "home button"

so = fuction(){


I've loads of movieclips and don't really have time to write everything so am just hoping there's a quick fix.

Tried _root, but doesn't bring everything back to their respective Frame 1.

Thanks for any help,
(I'd be lost without creative cow!!)


Return to posts index

demetri tashie
Re: [AS2] is there a way to call ALL movie clips with an onRelease?(AS3 response)
on May 16, 2009 at 11:40:14 pm

hey dan -

i am no longer fluent in AS2 (never really was). i speak only AS3 now. the way i would ( and did) attack your question was to use an Array, containing all the names of the Movie clips, and then used the array to call out to each clip to perform the same function ( goto and Stop on first frame )

a down and dirty sample is posted here ( 'raw' swf, so resize down your browser):

1) a movie clip instance name "btn1" to act as the button to trigger the function

2)movie clip one has instance name of "mc1" , movieclip 2 has instance name of "mc2". make as many clips as you want.

3) i named my array "aRay" and populated it with the name of the movie clips ( ie mc1 and mc2)
4) funA is triggered by btn1 and then triggers funB, which is attached to the array

the AS3 code to do this is such. You can maybe figure out the AS2 version from this:

btn1.addEventListener(MouseEvent.CLICK, funA );

var aRay:Array = new Array();

function funA(evt:MouseEvent):void{


function funB(element:*,index:int,aRay:Array):void {

hope this helps - it should save a lot of lines of code!

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved