|
-
Custom message once all 3 buttons have been clicked?
Hi All,
I need to create a movie that has 3 scenes that can be bounced to via button clicks. I need it to track where the person has been and tells them you have clicked on all three buttons click here to continue.
Well I have all my scenes set up and the buttons are working fine I'm just not sure how to make my movie track the buttons and deliver the message once all 3 buttons have been clicked.
(You've clicked all 3 now proceed here)
Anyone have any input???
Last edited by nonamenoslogan; 11-22-2005 at 04:18 PM.
-
Flash Gordon
to keep it simple, i'd suggest the following,
on every buttonclick you call a function
Code:
on (release){
_root.buttonClick("but1");
}
in your main timeline (first scene)
you will then have the following code:
Code:
butsPressed=new Array();
function buttonClick(butID){
butsPressed[butID] = true;
if(butsPressed["but1"] && butsPressed["but2"] && butsPressed["but3"]){
// do some things..
}
Got what i am after?
[edit]
You must make sure u never enter Frame1 in that first Scene again
or the butsPressed - array will be set to a new one again..
-
I'm picking up what your laying down, but it doesn't appear to be keeping track of the buttons that have been pressed.
What I have now is a third frame in my original timeline that it is supposed to jump to once you have clicked all 3. It at no time goes back to the 1st frame and reset the array, but it still doesn't do what it's supposed to either.
-
Flash Gordon
Hmm.. mostly hard to tell, what is going wrong without the fla.
I'll give a hint:
Add to the buttonClick function the following code:
Code:
for(test in butsPressed){
trace(test+") "+butsPressed[test];
}
This should output all set Array elements..
As i just tested my code partly there might be a slight
glitch i did not think of..
-
I'm getting the same results with this tracing code. I would upload my fla if I could. I'm still having some issues, not quite sure why. I wonder if I loaded my buttons into a new level if that would help.
Basically I have 4 scenes that I jump to. The first being the main page and the other 3 being the sub categories. I wonder if I took my buttons and loaded them into a new swf and called them to a different level if that would work.
Or am I just way over thinking this?
I was just thinking. When I go to my seperate scenes there is a back button on each that brings you back to the main scene. It seems to me that I would have to add some actionscript to this button as well.
Last edited by nonamenoslogan; 11-23-2005 at 11:24 AM.
-
Flash Gordon
Hmm, i understand, what you are trying to achieve.
I would guess currently there is just a tiny bit going wrong..
Like is that "tracking function" really located in _root?
Loading the buttons in another _level might shift the problem
only to another place..
Do some more trace() actions to locate, what is going wrong
i.E.:
Code:
butsPressed=new Array();
trace("New butsPressed Array");
function buttonClick(butID){
butsPressed[butID] = true;
trace("but "+butID +" saved, check: "+butsPressed[butID]);
if(butsPressed["but1"] && butsPressed["but2"] && butsPressed["but3"]){
// do some things..
}
trace("--- check --- ");
for(test in butsPressed){
trace(test+") "+butsPressed[test]);
}
}
I am outta ideas, how i could help any further..
Last edited by McUsher; 11-23-2005 at 11:28 AM.
My letters on the F1 key have faded, how are yours today?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|