Click, Clear Stage Scene, THEN New Scene
I think this is a common problem, but I haven't found the common solution. We've discussed this a little on a another thread, but we didn't really come up with a solution.
I know a lot of people want to have a button (well, multiple buttons), that when you click on it, it gotoAndPlay()s a scene that clears the stage, and THEN goes to a new scene (or in my case webpage) based on what button was clicked.
I know the answer has to be some use of variables and actionscript, but I haven't been able to puzzle it out, being new to flash.
Does anyone know the solution, or better yet, have a .fla file with the solution (so we can all see greatness in action)?
Thanks!
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-11-2001, 03:30 PM
View Complete Forum Thread with Replies
Sponsored Links:
- Photo Gallery: Last Image Doesn't Clear On GotoAndPlay On Different Scene
- Won't Change Scene...neither With Actionscript,neither From Scene To Scene
- On Click Go To Scene 2
- MC Will Not Go To New Scene On Click
- Click Button And Take Me To Scene
- On Click Loading Scene 2
- Button Click To Scene
- Fade To Scene Through Button Click. Use Var?
- Mouse Click Sound Throughout Scene
- Click Here To Activate For IE & Scene Problems
- [F8] Flash Site, Multiple Scenes, Button Moves Scene To Scene Instead Of Navigating
- Scene 3 Goes Beyond Stage Shows Everything How Can I Remove That?
- Getting Back On Scene/Stage/Root...uhm?
- Click To A Scene In Main Movie From External SWF?
- Make A Button Where When You Click On It You Goto The Next Scene?
- Help With Passing Number From Scene 1 To Scene 2's Dynamic Text Field
- Targeting Frame Label In Scene From Movie Clip In Same Scene
- Simple Gotoandplay - Animate The Scene Out Before Playing Selected Scene?
- Scene 2 Works Fine, But When Preloaded Added Scene Will Not Work
- Play The Rest Of Current Scene, THEN Gotoandplay Another Pre-determined Scene
- Scene -> Object? Turning A Scene Into An Importable Symbol For Other Projects
- Interative Button (down Stage'll Remain On The Scene)
- Buttons Not Clickable On Test Scene Stage
- Placing A Scene Movie Clip On The Stage?
- Move Entire Contents Of Scene Around Stage?
- Whats The Action Script Where You Click Somethin And It Goes To Another Scene?
- [FMX04] Changing Background For A Image With One Click On EVERY Scene - How ?
- Sound Plays From Next Scene, While Playing In Current Scene?
- I Cant Navigate 1 Scene From Another Scene Thorogh Movie Clip
- On My Movie, At The Middle Of The 3rd Scene, Goes And Plays The Sounds On 4 Scene...m
- Button Relase; Play Curent Scene And Go (scene)
- How To Disable The Intro Sound When Switching From 1 Scene To 2nd Scene
- Buttons Aren't Going To Correct Scene, Just Progresses To Next Scene :(
- How Do You Delete / Remove / Unload Xml Jpeg Image From Stage Once Scene Changes?
- How Do You Delete / Remove / Unload Xml Jpeg Image From Stage When The Scene Changes?
- Button In Scene 1 Loads A Specific Mc In Scene 2?
- Loader Scene -> Movie Scene Problem
- On Release - Finish Scene - Goto Scene?
- Playing A Scene When Current Scene Ends
- Sound Bleed From Scene To Scene: Newbie Needs Help
- Calling Actionscript Menu From Scene To Scene
- Button Action - Finish Scene And Go To Other Scene
- Play, Pause, Next Scene, Previous Scene.
- Target Frame In Scene From Movie In Same Scene
- [F8] Button Script - Play Until The End Of The Scene, Then Go To Scene X
- Remember User Actions From Scene To Scene
- Passing Positional Variables From Scene To Scene...
- Access Scene 2 From Movie Clip In Scene 1
- Button Script - Play Until The End Of The Scene, Then Go To Scene X
- Remember User Actions From Scene To Scene
- Copying Game Score From Scene To Scene
Photo Gallery: Last Image Doesn't Clear On GotoAndPlay On Different Scene
I've built this photo gallery, using a tutorial book, standard script. The rub is that I can view the thumbnails fine they switch, however whatever the last photo is stays.
I click on my button with the script below.
home_btn.onRelease=function(){
gotoAndPlay ("Scene 1", 141);
}
Once it's clicked, flash goes to the appropriate from in Scene 1, but the movie(photo) is still on displaying. I've tried about about everything, new buttons, tried to trick it to load a movie only had a transparent box.
Why does it continue to display the movie(photo)?
View Replies !
View Related
MC Will Not Go To New Scene On Click
ok i have animated mc's that i want to, on click, travel to another scene. ive tried different things and am lost. heres the code adn link to page:
PHP Code:
function proximity(clip, music) {
var x:Number = _root._xmouse;
var y:Number = _root._ymouse;
var cx:Number = clip._x;
var cy:Number = clip._y;
var prox:Number = Math.sqrt((x-cx)*(x-cx)+(y-cy)*(y-cy));
if (prox<70) {
music.setVolume(70-prox);
clip._xscale = 145-prox;
clip._yscale = clip._xscale;
} else {
music.setVolume(0);
clip._xscale = 70;
clip._yscale = clip._xscale;
}
}
var toxiclabSound:Sound = new Sound(toxiclab);
var tutorializedSound:Sound = new Sound(tutorialized);
var homeSound:Sound = new Sound(home);
var soonSound:Sound = new soon(home);
this.onEnterFrame = function() {
proximity(toxiclab,toxiclabSound);
proximity(tutorialized, tutorializedSound);
proximity(home,homeSound);
proximity(soon,soonSound);
};
toxiclab.onRollOver = tutorialized.onRollOver = home.onRollOver = soon.onRollOver=function () { this.swapDepths(_root.getNextHighestDepth());};
stop();
that is all under my actions layer.
View Replies !
View Related
Button Click To Scene
I'm just starting to learn AS3 and I'm forcing my self to not give up and do my whole current project in AS3. Only thing is, the simple click button and go to a scene is where I'm stuck. I'm hoping some one could tell me what I'm doing wrong and point me in the right direction by looking over my code.
This is my code, I have it placed on scene 1 frame one. I have two buttons named theBand_btn and coletteFBand. When you click on a button, for example theBand_btn I wand it to take you to a scene called "The_Band" scene 1 and stop
ActionScript Code:
stop();
import flash.events.MouseEvent;
theBand_btn.addEventListener(MouseEvent.CLICK,theBand);
function theBand(event:MouseEvent):void {
gotoAndStop("The_Band");
}
coletteFBand_btn.addEventListener(MouseEvent.CLICK,coletteFBand);
function coletteFBand(event:MouseEvent):void {
gotoAndStop("Colette");
}
I do have a "stop(); command in every scene layer 1 scene one just to be safe, but what is happening is after adding this code, it just races through the scenes and does not stop.
I also have a compiler error that says:
Description: 1120: Access of undefined property theBand_btn.
Source: theBand_btn.addEventListener(MouseEvent.CLICK,theB and);
Description: 1120: Access of undefined property coletteFBand_btn.
Source: coletteFBand_btn.addEventListener(MouseEvent.CLICK ,coletteFBand);
Thank you, and I hope this is a simple fix
View Replies !
View Related
Fade To Scene Through Button Click. Use Var?
ok, I am moving along. I have decided to try and teach myself as much as possible. SO I am making this demo site. One that I am learning from.
My big idea is really basic. you fade into the home scene. The at the top are buttons. CLick on button 'services' and the scene fades out and loads scene services.
attached my fla. i think i am doing it the hard way. LOL but at least the idea is there... LOL
View Replies !
View Related
Click Here To Activate For IE & Scene Problems
OK first,
I would like to know if anyone knows a solution for the (Click Here To Activate) When using IE. Now, I know about the java thing to download and upload to the server and all that, it works great. But with that java script in my page, it never stops loading, but with i take it out its fine, besides the fact that you have to click to activate.
Second,
When i make my sights, instead of loading pages, i load scenes. so when ever i add, lets say more items to my navigation menu, thats something that need to be done on each scene. So i have to go into each scene and add them. Now, with a lot of scenes like 50, that takes awhile. Is there an easier way, like a (add to all scenes button or something?)
any advice would be greatly appreciated... THANK YOU!
View Replies !
View Related
[F8] Flash Site, Multiple Scenes, Button Moves Scene To Scene Instead Of Navigating
Hi...I am very new at flash, so forgive my ignorance in advance...I really really need help!
I created a site, separated into scenes (intro, main-home, about, portfolio, press, contact).
About half the time the navigational buttons work fine. However, the other half of the time one of the buttons, the Press button, instead of bringing me to the Press scene, just moves scene to scene (for example, say I'm on the home page and I want to go to the Press page, it just goes to the about page...I hit the button again it goes to the Portfolio page, etc.). I think the problem lies somewhere in bypassing the intro prematurely (you can skip intro and go straight to the site/home-main scene), but I'm not positive.
Here's the code for the Press button:
on (release) {
gotoAndPlay("press", "pressframe");
}
where pressframe is the name of the first frames in the Press scene.
I can upload the fla file to my own site for download and review if necessary....
Please help!....I am losing sleep and hair over this.
View Replies !
View Related
Getting Back On Scene/Stage/Root...uhm?
I'm totally stuck...
At the end of a movieclip I want to return to the main stage so my code is like this:
stop();
_root.gotoAndStop(2);
Now, I get an error-warning using _root and I've read through my books searching for the right answer. No luck.
My logic the tell me that I could just replace _root with Stage, Scene or even parent. But... No luck!
So... What do I do?
In AS2 _root.gotoAndStop(2) is the right answer.. But now AS3 is making the world crash around me and I have to deal with it.. Sometimes it gets ugly... :p
Any help out there??
View Replies !
View Related
Help With Passing Number From Scene 1 To Scene 2's Dynamic Text Field
hi all ,
i have 2 scenes on the first i retreve user information from flash and through php to a mysql database then send it back to flash. on one of the lines i retreive a id number
content.htmlText += " <a href='#" + this["id"+i] + "'>" + this["id"+i] + "</a><br><br>";
when the user clicks on this ahref i want to goto scene 2 and insert the id into a dynamic textfield with an instance name of "recorde_id"
this scene is complete and works it retreives more infor about the user..
but i have to manualy enter a id number into a INPUT filed i want it to be automatic that why i have changed it to be dynamic so it can capter the ahref from scene 1.. if you need more code or information just ask and ill deliver, im a flash newbee..
cheers aron.
View Replies !
View Related
Targeting Frame Label In Scene From Movie Clip In Same Scene
Hey Pals,
I'm trying to target a frame label on the timeline of a scene from a movie clip within the same scene, using Flash MX 2004 Pro. The scene is ultimately used as a .swf to load as a page of a website. The frame label is called "miscOn", the scene is called "misc". The below code is attached to a button within the movie clip.
on (release) {
loadMovieNum("tajwebsite_main.swf",1);
gotoAndPlay(miscOn);
}
Thanks!
Stu
View Replies !
View Related
Simple Gotoandplay - Animate The Scene Out Before Playing Selected Scene?
Hey there again,
Just wondering if you guys could point me in the right direction.
Before, when I made full-flash websites, when I clicked a button I'd have it gotoandplay frame 60 or whatever (or scene 2 or 3 or 4 etc.) and that page would start up there and have a nice little animating intro but it would be a very abrupt start because anything on the previous page would just disappeer jaggedly.
But I've seen a lot of nice sites, that once you press a button, it'll clean up the current scene, say have everything burn out or fade or or something instead of just having the next option just appear, then go to the selected page. Say they clicked News or Contact, and they were on products. It would allow me to have a timeline to animate all the objects out (just a simple tween) then once it reached the end and all the objects were out, it knew which button they pressed and where to gotoandplay.
This is probably easy actionscripting (or not, I have no clue) so it would be greatly appreciated if someone could direct me, thanks!
View Replies !
View Related
Scene 2 Works Fine, But When Preloaded Added Scene Will Not Work
I have a website at wosso.com which I needed a preloader. So currently the site works fine. I am toying with a preloaded, but when I add it the main part of the site does not function.
There are two scenes, PRELOADER and SCENE 1. My preloader includes this script in the first frame of the preloader: ifFrameLoaded ("Scene 1", 105){
gotoAndPlay ("Scene 1", 1);
}
I have also inluded this line at the end of the preloader, but also tried it without this line:
gotoAndPlay ("Preload", 1);
I haven't used Flash in some time and I am not good at scripting. It seems to make sense, but why is it not working when SCnene 1 works fine by itself.
Any sulotion/suggestions?
Thanks,
Wayne
View Replies !
View Related
Play The Rest Of Current Scene, THEN Gotoandplay Another Pre-determined Scene
Hi,
Im my scene contains 6 buttons, I want button '1' to play the rest of the current scene (for example scene '0' then goto and play scene '1'
I want button '2' to play the rest of the current scene (for example scene '0' then goto and play scene '2'
I want button '3' to play the rest of the current scene (for example scene '0' then goto and play scene '3'
etc....
any ideas? this is for actionscript 3. My current script just makes the button goto a certain frame, can I edit it? here it is:
stop();
thumbbtn1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent):void {
gotoAndStop(2);
}
thumbbtn2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void {
gotoAndStop(3);
any help greatly appreciated.
Ger
View Replies !
View Related
Interative Button (down Stage'll Remain On The Scene)
Hi,
I'm a Flash newbie and new to this forum too.
I know how to create a simple buttons, but I have
no idea of how to create a button which will triggle
the down stage remain on the scene when it's clicked.
I tried to create a movie-clip button with 3 keyframes
(up, over and down). The button will show the
down keyframe when it's clicked. However, it'll
disappear when my mouse is out of the button.
(i create a mouse out action to the button).
In this case, do I need to create a new scene to do that?
Or are there any simplest methods?
Wish someone can help me.
Thanks.
GOLF
View Replies !
View Related
Buttons Not Clickable On Test Scene Stage
My version of Flash MX must be corrupted because I can no longer created buttons that link to url's. Even a simplistic button that links to a url on press will no longer work. When I test scene or movie I can no longer click on buttons.
Has anyone heard of such a thing? What happens to my MX?
View Replies !
View Related
Placing A Scene Movie Clip On The Stage?
Help!!!!
May be im being simple but i am new to flash and just cant get my movie clip to appear on my Stage. I created a flash animation as a Scene so it would appear in my library, for me to drag and drop on my stage or timeline. I have tried to ad the same amount of key frames as were in my animation and then drag it in to my timeline and that didn't work either, well something appeared but it was just a inviolable symbol I think.
Do I need to do the animation in another stage rather than scene? or Im i doing it all wrong? I now I can copy the keyframes and just put them in the stage timeline but its a large animation that I was planing on putting a action script on, so i would prefer just one layer with it all on.
Im sure its just a school boy error but could someone please help its driving me insane!
View Replies !
View Related
Move Entire Contents Of Scene Around Stage?
I am a "build-it-all-on-the-stage" kind of guy -
I have finished a small animated ad for a 'client', so of course now, right at the end he wants a black panel addeed to the top of the movie!!
I know I can change the dimensions of the movie via the property manager, but it only adds the extra 100px to the very bottom - and I want it at the top!
How do I move the entire contents of my movie down the stage? ie - every frame, tween & layer?
View Replies !
View Related
[FMX04] Changing Background For A Image With One Click On EVERY Scene - How ?
Hi there, i was wondering of any of can helpme with this dilema i have.
I have set up ma flash project to have various scenes.
One of these scenes is a page whereby when a user clicks on a button he/she can change the background image on every scene in my project.
On each scene i have made a layer called 'background' and drawn a black rectangle which is the default background. This has been converted to a graphic using F8.
What i'd like to be able to do is when the user clicks on the button he/she can change this default background to 1 of 4 photo's i have in my library.
i have tried the code:
on (release)
{
colorchange = new Color("/rectangle");
colorchange.setRGB(0x0000FF);
}
but all this does is change the colour of the background and not the photo i have in my library. Please also note i have to have this change applied to all my scenes.
I hope someone can help, Many Thanks
View Replies !
View Related
I Cant Navigate 1 Scene From Another Scene Thorogh Movie Clip
SIr i made a Movie Clip and in the movie clip there are 4 buttons when i want to use the button so go to another scence it cant happen so how can i go to Another scene by the button which is present in the MOVIE clip
i think u understand my Problem
simply summary is that i there is a button in the movie clip and i want to use the button to go to another scene but it cant happen
Thk u in adnvance for any body Consideration
View Replies !
View Related
Button Relase; Play Curent Scene And Go (scene)
I need a bit of help, and its hard to explain. I have a menu that consist of 6 buttons on Scene1. I want to be able to click on a button and play scene1,frame37, then after it finishes playing I want it to move over the designated scene from the button pressed.
//This is what I currently have which makes the button play the ending of the scene.
on (release)
{gotoAndPlay( "scene 1", "fadeout");
}
//I need to finish the actionscrip by going to a different scene after it finishes playing the current scene. This is for all the buttons.
Example:
Button1 needs to play "scene 1", "37" then go to scene 3
Button2 needs to play "scene 1", "37" then go to scene 4
(any button) to Play "scene 1", "37" then go to (scnen asign from button)
and so on.
Any feedback is greatly appreciated.
View Replies !
View Related
Buttons Aren't Going To Correct Scene, Just Progresses To Next Scene :(
Anyone ever have the problem when your buttons have the code to jump to a specific scene, they just jump to the next scene on your palette instead?
For instance, I've got 6 buttons that I need to operate as a normal HTML site. So I programmed each button to jump to the corresponding scene with...
Code:
on(release) {
gotoAndPlay("fine, frame1");
}
In this situation, that button needs to jump to the scene "fine", but instead, when I click on it, it simply jumps to the next scene in the scene palette (which isn't "fine").
Interestingly as well, once it scrolls through all 6 scenes (by clicking on any button 6 times), it starts over with the first scene again.
Anybody know what I am doing wrong?
Thanks!
View Replies !
View Related
How Do You Delete / Remove / Unload Xml Jpeg Image From Stage Once Scene Changes?
based on attached file: "slideshow"
Scenario:
suppose after view one slideshow (scene1 slideshow) you want to transition to a new scene (scene2 slideshow) with a completely different slideshow. via clicking on a menu button that takes you to that new scene.
so far I am able to get to new scene but the images from the previous scene (scene 1) xml jpeg image remains on the stage in the new scene (scene 2)
is this a image cache problem? The jpeg is still there but the other stage elements do not remain on the stage in the new scene.
How do I remove, delete them, unload or get the xml jpegs from scene 1 out of scene 2
please help
View Replies !
View Related
How Do You Delete / Remove / Unload Xml Jpeg Image From Stage When The Scene Changes?
Scenario:
3 scenes
scene 1 "home"
scene 2 slideshow1 "images" (XML images and file)
scene 3 slideshow2 "images1" (XML images and file)
see attached file: "slideshow"
so far I am able to get to new scene but the images from the previous scene xml jpeg images remains on the stage when you go back to the "home" scene or to another scene.
How do I unload (delete/remove/destroy) the XML jpeg data from the stage when you go to a new scene?
is this a image cache problem? How can I correct this?????
please help!!!!!
View Replies !
View Related
Button In Scene 1 Loads A Specific Mc In Scene 2?
Unfortunately my brain isn't really designed for understanding or figuring our ActionScript very well... Here's what I'm trying to do and the problem:
The user arrives at a 'splash screen' in Scene 1 which gives them the option to choose to view the demo in 'interactive' or 'autorun' mode (the two modes are slightly different in terms of their content so I'll have two separate scenes, Scene 2 will contain all the 'interactive' movie clips and Scene 3 will contain all the 'autorun' movie clips). The user can then choose whether they'd like to view the demo with the sound on or off. Once they've made this selection they'll be taken to the opening animation of the mode (i.e. interactive or autorun) they selected, with the sound on or off as they specified.
What ActionScript needs to be applied to the sound on or off buttons in Scene 1 to ensure that the correct sound movie clip loads at the beginning of Scene 2 or Scene 3.
If the user initially decided to view the demo in autorun mode they will be able to change to interactive mode at any time... how can I ensure the sound setting they have selected remains unchanged across Scenes (and they can choose to turn the sound on or off at any time)?
I need to create this as a single SWF - I can have as many Scenes and movie clips as is necessary but cannot use loadMovie and multiple SWF's
If anyone has any ideas I'd love to hear them! I just can't figure it out and I'm getting REALLY desperate!
Thanks!
View Replies !
View Related
Loader Scene -> Movie Scene Problem
When my preloader finishes loading my movie, and i use gotoandplay ("Movie", 1), something goes wrong. When it is done loading, it continues on to the "Movie" Scene, but keeps switching rapidly between the load scene and movie scene. I need to know how to completely turn off the loader scene when it completes. Thanks
View Replies !
View Related
On Release - Finish Scene - Goto Scene?
I have a navigation scene with buttons that is 100 frames but stops to allow navigation at 50.
What is the correct script to add to the buttons that allows me to finish the current scene to frame 100, then go to required scene??
Help is greatly appreciated.
Thanks,
Nick
View Replies !
View Related
Playing A Scene When Current Scene Ends
I don't want to come sound like and idiot, but i am stuck on one of the most simplest things.
i have 3 scenes, and in my first scene, i have two buttons.
The first button plays the rest of the first scene and then goes to the 2nd scene.
But!<
the 2nd button is meant to play the rest of the first scene and then go to the 3rd scene, but i don't know how! I've tried the 'and' statement, '+' etc but nothing works.
Any help would be greatly appreciated!
View Replies !
View Related
Sound Bleed From Scene To Scene: Newbie Needs Help
im just learning flash mx
i have a simple scene with a background sound looping on a layer continuously.
once that scene is done the next scene loads up with its own back ground sound
my problem is that the first scenes background sound bleeds into the 2nd scene.. and so on..
it does end eventually
but how do i make it stop exactly when that scene is done.??
this must have an easy explanation
please help the newbie
View Replies !
View Related
Calling Actionscript Menu From Scene To Scene
PLEASE HELP!!!
I'm using an actionscript menu that shifts up an down on one scene. Inside one position of the menu I have lots of small pictures that I'd like to open in another scene using the same movement like menu and on the second scene I have diferent positions for each pictures. How can I call a position in the second scene from the first (take under consideration that I use only the first frame of the main movie clip on each scene - from there the script does all the work).
thanks
PS. U can take a look at www.dtpmedia.ro
View Replies !
View Related
Button Action - Finish Scene And Go To Other Scene
hello and thanks for any help,
i have a main scene that runs to frame 125 and stops.
i have a few buttons, each one i want to (upon click) continue the movie (up to, say, frame 130, which has my 'transitional fade') and then go to the corresponding scene (each button corresponds to it's own scene).
this is what i've been trying, and it's continuing past the 'stop' but not going to the scene:
button:
on (release) {
_root.choice = 1;
_root.play();
}
frame 125
stop();
if (_root.choice == 1){
_root.gotoAndPlay("Scene 2",1)
}
if (_root.choice == 2){
_root.gotoAndPlay("Scene 3",1)
}
thanks a lot !
View Replies !
View Related
Play, Pause, Next Scene, Previous Scene.
Hi all, could some give me an example of Play, Pause, Next Scene, Previous Scene, preferably in action script 2. (Flash MX 2004)
Id like it to work like so…
Pause - Pauses sound and movie.
Play – Continue Movie and sound were it was paused.
Next/Previous Scene - +1/-1 to current scene so that I would not need to edit it for each slide. (Is this possible?)
I’m reflectively new to action script so please don’t bite.
Thx in advance.
View Replies !
View Related
[F8] Button Script - Play Until The End Of The Scene, Then Go To Scene X
I'm just a newbie to actionscript, but I'm working on a project in which the following is vital, and I was really hoping that someone might be able to give me a helping hand.
- Scene A lasts for 100 frames, and it includes a button on one layer (lasting from frame 1 - 100) that links to Scene B - pretty standard fare.
- When the user clicks the button at any time within these 100 frames, I need the Scene A to play until the end (frame 100), then go to Scene B.
The reason behind this is that I would like the video clip of Scene A to have a seamless transition into the video clip of Scene B, and the only way I see this happening is to force Scene A to end before playing Scene B.
To sum up, is there any method to delay the event of a button (such as gotoAndPlay("Scene B", 1), until the end of Scene A, or until a specific frame? (whichever is easier)
Sorry for any confusion - If the above explanation is unclear, just let me know and I'll try to write it more precisely.
Many thanks, and any help would be extremely appreciated!
Costas
View Replies !
View Related
Remember User Actions From Scene To Scene
I am making a "slide show story" where every slide is a micro story and the user decides on his/her own when to go to the next slide.
Every slide is a separate scene and every slide has it's own soundfile attached. I have made a mute button on the first slide but the way it is now the file "forgets" from slide to slide (scene to scene) that is it supposed to be mute (if people choose to have it muted). I have no idea how to make it remember that the sound is supposed to be mute on slide 2 or 3 if the mute button was pressed on slide 1.
My actionscript looks like this:
var music:Sound = new Sound(new URLRequest("pic1.mp3"));
var sc:SoundChannel = music.play();
var soundVolume:Number = 1;
var muted:Boolean = false;
mute_mc.buttonMode = true;
mute_mc.addEventListener(MouseEvent.CLICK, mute);
function mute(e:MouseEvent):void {
if (sc !=null) {
var st:SoundTransform;
if (muted) {
st = new SoundTransform(soundVolume);
sc.soundTransform = st;
mute_mc.gotoAndStop("On");
muted = false;
} else {
st = new SoundTransform(0);
sc.soundTransform = st;
mute_mc.gotoAndStop("Mute");
muted = true;
}
}
}
button_next1.addEventListener(MouseEvent.CLICK, buttonNEXT1);
function buttonNEXT1(event:MouseEvent):void {
SoundMixer.stopAll();
nextScene();
play();
}
and of course on the last frame of the scene I have the stop command so that the the next button needs to be pressed to get to the next scene.
So do you have any help for me, or any tutorials that you could tell me about?
Edda Rós
View Replies !
View Related
Passing Positional Variables From Scene To Scene...
hello, i'm terribly new to actionscript, terribly new to flash, and terribly new to these forums, so please let me apologize if i'm getting ahead of myself with my question, or asking it in the innapropriate place here.
i have a portfolio site i'm trying to get to work that mimics the layers palette of photoshop (eventually i'm hoping to mimic much more of the interface too, eg enabling the rulers to slide freely the way they do in photoshop).
>> www.einungdesign.com
i have built the project as a series of scenes, with each page being its own separate scene. however, i'd like the layers palette (which the user can reposition) to pass its x/y position from scene to scene so that the pallette appears to function independently from the scenes.
unfortunately, i don't really know how to do this, while i can imagine it will something along the lines of a statement that positions the palette clip at the x/y variable taken from its position at the time of clicking from another scene.
i'd greatly appreciate any help or suggestions anyone might have for this, would be great to get it working properly, and i would use this information to enable the other interface elements to do similar things (eg, again, the rulers).
thanks in advance.
View Replies !
View Related
Access Scene 2 From Movie Clip In Scene 1
I placed a button inside a movie clicp symbol in Scene 1.
Now I wan to set the button to play scene 2 when I click it.
I tryed
on (press) {
gotoAndPlay("Scene 2", 1);
}
and also
on (press) {
_root.gotoAndPlay("Scene 2", 1);
}
But it plays the movie clip symbol from the beggining Not the scene 2
An example file is attached. I should be able to click on the blue square (thats the button inside themovie clip ) and go to scene 2
View Replies !
View Related
Button Script - Play Until The End Of The Scene, Then Go To Scene X
I'm just a newbie to actionscript, but I'm working on a project in which the following is vital, and I was really hoping that someone might be able to give me a helping hand.
- Scene A lasts for 100 frames, and it includes a button on one layer (lasting from frame 1 - 100) that links to Scene B - pretty standard fare.
- When the user clicks the button at any time within these 100 frames, I need the Scene A to play until the end (frame 100), then go to Scene B.
The reason behind this is that I would like the video clip of Scene A to have a seamless transition into the video clip of Scene B, and the only way I see this happening is to force Scene A to end before playing Scene B.
To sum up, is there any method to delay the event of a button (such as gotoAndPlay("Scene B", 1), until the end of Scene A, or until a specific frame? (whichever is easier)
Sorry for any confusion - If the above explanation is unclear, just let me know and I'll try to write it more precisely.
Many thanks, and any help would be extremely appreciated!
Costas
View Replies !
View Related
Remember User Actions From Scene To Scene
I am making a "slide show story" where every slide is a micro story and the user decides on his/her own when to go to the next slide.
Every slide is a separate scene and every slide has it's own soundfile attached. I have made a mute button on the first slide but the way it is now the file "forgets" from slide to slide (scene to scene) that is it supposed to be mute (if people choose to have it muted). I have no idea how to make it remember that the sound is supposed to be mute on slide 2 or 3 if the mute button was pressed on slide 1.
My actionscript looks like this:
var music:Sound = new Sound(new URLRequest("pic1.mp3"));
var sc:SoundChannel = music.play();
var soundVolume:Number = 1;
var muted:Boolean = false;
mute_mc.buttonMode = true;
mute_mc.addEventListener(MouseEvent.CLICK, mute);
function mute(e:MouseEvent):void {
if (sc !=null) {
var st:SoundTransform;
if (muted) {
st = new SoundTransform(soundVolume);
sc.soundTransform = st;
mute_mc.gotoAndStop("On");
muted = false;
} else {
st = new SoundTransform(0);
sc.soundTransform = st;
mute_mc.gotoAndStop("Mute");
muted = true;
}
}
}
button_next1.addEventListener(MouseEvent.CLICK, buttonNEXT1);
function buttonNEXT1(event:MouseEvent):void {
SoundMixer.stopAll();
nextScene();
play();
}
and of course on the last frame of the scene I have the stop command so that the the next button needs to be pressed to get to the next scene.
So do you have any help for me, or any tutorials that you could tell me about?
Edda Rós
View Replies !
View Related
Copying Game Score From Scene To Scene
Hi:
I've created a game that involves 10 questions. Each question is in its own scene. I've been racking my small brain trying to find a way to copy the user's score from scene to scene and add (or deduct) points based on whether the user answers the question correctly or incorrectly.
Any ideas or places to go to check out some sample script? Or am I missing something obvious.
Thanks.
Happy New Year
Tim
View Replies !
View Related
|