Skip to main content
Participating Frequently
December 4, 2009
Question

Please I need Help!!! Movie Clips problem...

  • December 4, 2009
  • 5 replies
  • 1139 views

I really hope you can help me! I am desperate!

My main scene in only on 2 frames.

On the second layers I have some buttons that activate my movie clips (on the third layer)...

These buttons can be pressed 'randomly' and after the muvie clips are played my buttons (one by one) disappear to

reaveal what on the first layer. Here there's another button, but I want it to be active only after all my movie clips have been played.

...here is the problem: what kind of ActionScript should I use to tell flash to go to the second frame of my time line (where my button on the first layer is active) only after all the mcs have been played?

I tried everything I know, but I confess I am mostly a designer so my knowledge of Action Script is not so grent!

Thanks for your help!

Faith

This topic has been closed for replies.

5 replies

FaithnycAuthor
Participating Frequently
December 7, 2009

I am sorry I am here again...

I have posted my question everywhere in many forums with any good answer at the moment.

My file at the moment are in AS2 and I am willing to change everything in AS3 even if I've just started to approch them only a couple of weeks ago...

Do you know which is the best way to go?

In the attached file the right buttons are the red ones...  if you want to take a look would be great.

This should be a second part of a game. People who arrive at this stage should now which are the right buttons to press. If they press the right one a pop up opens and some buttons disappear to reveal the massage that's behind. When all the right buttons have been pressed I need to play the frame 'end' on my timeline...

Thanks

-Faith

FaithnycAuthor
Participating Frequently
December 6, 2009

Anybody can figure out what I can do?

I am getting crazy...

FaithnycAuthor
Participating Frequently
December 6, 2009

I tried this as one of you suggested and this work... it goes to the frame 'end' but it doesn't play my MovieClips. Any ideas what should I add to make it work?

var numItems:Number=16;


var visitedCount:Number=0;
var allVisited:Number=Math.pow(2,numItems)-1;

for(var i=0;i<numItems;i++){
var curClip:MovieClip=this["myClip"+i];
curClip.id=i;
curClip.onRelease=clipReleased;
}

function clipReleased(){
visitCount |= 1<<this.id
if(visitCount==allVisited){
// They have all been visited

gotoAndPlay('end')

} else {

// They have not all been visited.

gotoAndPlay('start')

}

}

FaithnycAuthor
Participating Frequently
December 6, 2009

I am still try to figure out how to make this thing work... I tried with your suggestions but I wrong something.

This should be a second part of a game. People who arrive at this stage should now which are the right buttons to press. If they press the right one a pop up opens and some buttons desapear to reaveal the massage that's behind. When all the right buttons have been pressed I need to play the frame 'end' on my timeline...

In the attached file the right buttons are the red ones...  if you wanna take a look would be great.

Thanks for your help.

Ned Murphy
Legend
December 4, 2009

One thing you could do is assign a "shown" variable to each movieclip, making it a boolean variable (true/false).  As each movieclip is displayed, its "shown" variable is set to true.  I don't know at which point or by what means you intend to allow the advance to frame 2, but what you would do is have a function that gets executed each time you access a movieclip and that function checks each movieclip to see if all of them have their "shown" variable set to true, and if so, allow the passage to frame 2.  If that button you mention is the access, then you essentially keep it invisible until that function makes it visible.

FaithnycAuthor
Participating Frequently
December 4, 2009

Your variable has much more sense than the one I was trying today... I'll try, I'll see if I can make it.

Thanks

Ned Murphy
Legend
December 4, 2009

You don't have to actually create such a variable inside the movieclips.  Movieclips are dynamic creatures that you can assign properties to dynamically.  So if you have one movieclip with an instance name of "mc1", you can just have code in frame 1 that declares...

mc1.shown = false;

That will have just created the shown variable for mc1 dynamically.  So when you click the button to display mc1, that button can set...

mc1.shown = true;

Then, your button code could also call the function that checks to see if all shown values are true.

December 4, 2009

Have Faith! (sorry I couldn't resist)

AS3 allows button events to pass through one another when they're active. Without looking at your file I can recommend that you set the lower button's mouseEnabled=false as well as buttonMode=false and, depending on the situation, enabled=false as well. Then turn all these back on when you want it active.

WL

FaithnycAuthor
Participating Frequently
December 4, 2009

Don't worry I am used to it.

I tried with mouseEnabled=false ect... but didn't work. the file am working on is complex I am building a simplified version I can post tomorrow and if you want to take a look would be great!

Thanks,

Faith