-
Actionscrip Newb In Need of Assistance!
Hi, I know much about using flash to create movies and the like, but in creating a full flash website I have come to the realization that I am an actionscript newb .
I have FLash MX 2004 Proffesional. If my computer were a person I would tell it to:
1.Play frames (0-20)
2.When complete with step 1, Go to Scene A
Its very simple, but every way I have tried has failed to work. It always skips directly to step 2. I think that I need to tell it to complete the first action before attempting the second, but I dont know how to do this. I tried using an if statement but all failed.
Please help me!
-
This might not be any help but why not try putting your
"gotoAndPlay(sceneA);" script on frame 20.
The movie will play through to frame 20 on its own, reach the action script then execute it.
Just a tip, try not to use scenes as i have only found them to be extremely difficult to handle, especially later down the track when you are trying to tell an action inside four movie clips to control an event on the main time line.. Gets to hard to try and swap scenes.
Instead, just have your new "scene" further down the time line and have your script say: "gotoAndPlay(24);"
eg:
Index page animation page 2 animation
1-------------------20(stop)24----------------------40(stop)
-
The problem is that this is for a site. Each page has a out sequence and an in sequence.
Lets say:
Page A is green
Page B is Red
page C is Blue
Green can go to red and blue
Red can go to green and blue
ect, ect.
When I am on page A (green) and I click link B(red) the move clip plays the fade out animation (in this case it is frame 31-60) then should skip to the proper scene which plays the fade in and lands me on the correct page.
A simple redirect on the last frame of the fade out wouldnt work because I have more than one link on the page.
Its hard to explain. If I am talking gibberish, tell me and I will attempt to clear it up. Ty treb for your quick response
-
try this on your button:
setting a variable when the buttong is pushed
pointer = "12" (12 could be the frame for your second page)
Now on your time line:
gotoAndPlay(pointer);
so if u had that on diffrent buttons:
pointer = "1"
pointer = "20"
pointer = "40"
then the time line will hopefully go to the variable.
Follow?
-
It makes sense, but I didnt seem to work. Maybe because I need the pointer to direct me to a scene, not a specific frame.
Heres the code I used.
For the button
on (press) {
pointer = "A";
gotoAndPlay(33);
}
For the Frame that Directs to the New Scene
gotoAndPlay("pointer", 1);
Just so you know, "A" is the name o the scene I am trying to get to.
-
I got something that works! ...But there is still a problem
For the button i have this code:
on (release) {
set(A, 1);
gotoAndPlay(33);
}
For the final redirecting frame I have this code:
if (A=1) {
gotoAndPlay("Support", 1);
}
The problem is, when I add a second button with this code:
on (release) {
set(A, 2);
gotoAndPlay(33);
}
And update the redirecting frame to:
if (A=1) {
gotoAndPlay("Support", 1);
}
if (A=2) {
gotoAndPlay("Pricing", 1);
}
When I run this even te button that used to work, now directs me to "pricing" not "support"
**To clear up any confusion "support" and "pricing" are the scene names. The number following them is the frame to play in the scene.
-
Personally this is why I find scenes difficult to dynamically refer to.
I don’t think action script can adequately handle them?
-
OK I figured out how to do it. Ty for all of your replies! If anyone wants to know ill post it, otherwie thanx again!
-
mrgoat, i'm interested in your solution. been trying to do something similar myself , but wasn't having any luck.
-
heres what i did:
For my support button i gave it this code
[a]on (release) {
gohere = "Sup";
gotoAndPlay(33);
}
[/a]
For the final redirecting frame I have:
[a]
switch (gohere) {
case "Cli" :
gotoAndPlay("Clients", 1);
break;
case "Pri" :
gotoAndPlay("Pricing", 1);
break;
case "Sup" :
gotoAndPlay("A", 1);
break;
case "Abo" :
gotoAndPlay("About", 1);
break;
default :
trace("ERROR");
break;
}
[/a]
of course "cli", "Pri", ect. are my other buttons.
Hope this helps
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
|