ActionScript 3.0 :: Create Buttons Triggering Switch MC In Loaded Swf

Oct 17, 2011

I'm currently working on a project which has a swf (zoom) which zoom/pan a loaded swf of a map (carte_web.swf). Everything went well until I got more requests.  There is now two maps, same background, one with images and one with only a road. I'm trying to add code to two buttons on a toolbar generated by the zoom.swf, to switch between the two maps, without loosing it's zoom/pan  My maps are both object-oriented Flash programming. I have spent 27 hours, trying to find a way and I'm definately at my wits' end!
 
I got a suggestion " in loading both your swfs into one sprite separately. Then switching between the swfs by removing and adding them to their parent sprite. The parent sprite is what you'll be zooming. "  I tried everything!!!

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Enter Key Triggering My Buttons?

Oct 16, 2009

what i've done is made an application where when you click on a "Proceed" button i've placed on stage said button is removed using removeChild() and more input fields are made available.a new button named "nextbutton" is also created at the same time to run a function which, when clicked, will check the input for validity and then advance the movie to the next frame if it all checks out.assuming the data does check out then the last command of the function (of the newly created "nextbutton" button) is to gotoAndStop(2); to advance the movie to the next frame.

i'm using the mouse_down mouseevent listener on both buttons to run my functions ie:

proceedbutton.addEventListener(MouseEvent.Mouse_Do wn, proceedbuttonCLICK);
nextbutton.addEventListener(MouseEvent.Mouse_Down, nextbuttonCLICK);

the problem i'm having is that if i tab thru my input textfields to enter data (and who doesn't) i end up tabbing to my "Proceed" button and then hitting the enter key. but if i hit enter on the button istead of clicking it then none of my if/else statements written into the nextbuttonCLICK function execute. even worse somehow the gotoAndStop(2); command somehow DOES execute (at least i think it does) because the movie advances to the next frame in my timeline. so now i'm at the next frame but my variables have not even been calculated ....what i don't get is the gotoAndStop(2); statement is written into the function for the "nextbuttonCLICK" so how the heck can hitting enter on a highlighted "Proceed" button have the effect it does? is it something built into the button class itself? i did choose to make my buttons "buttons" and not movie clips so the user would see the little hand cursor when mousing over them.

View 3 Replies

ActionScript 3.0 :: Triggering Movie Clips With Buttons?

May 28, 2009

I'm taking an intro Flash and Action Script class and for my final I need to create a portfolio project that contains 5 unique buttons that trigger 5 unique movie clips. I'm having a hard time with this. I've been able to trigger the 1st movie clip with the first button (although I can't stop it) but I can't trigger any ohter movies with any other buttons.

Here's my code:
stop();chuck1_btn.addEventListener(MouseEvent.CLICK, playMovie);
function playMovie(event:MouseEvent):void

[code].....

View 12 Replies

ActionScript 3.0 :: Triggering Function When Stage Has Loaded

Oct 11, 2009

I have a swf that I'm compiling for flash player 9. There's a few text fields on it that are selectable. When the page first loads, I want the first field to already be highlighted and ready for input.I've added this in the main function, and it works when I run the debugger or load it on my windows machine:[code]However, when I run the same swf on my linux machine the first field doesn't "highlight" until I click somewhere on the screen. Must be a linux thing.What's an alternate method to trigger an event when the stage has finished loading that I can try?

View 5 Replies

ActionScript 2.0 :: Triggering A Sound Object Once The SWf Is Loaded Into A Container SWF

Jun 23, 2003

I have a created a sound object like so:

//Creating the Sound Object
sliderSound = new Sound();

[Code].....

It works great when viewed. the problem is that when I load this SWF file into an container SWF file (using loadMovie) the sound will not play.

View 1 Replies

ActionScript 3.0 :: Create A Set Of Buttons Based On Loaded Images From Xml That OnClick Turn Red Or Grow In Size?

Jul 11, 2008

I want to create a set of buttons based on loaded images from xml that onClick turn red or grow in size, whatever, Clicking another turns that button red and the old one back to default. Alsoo it will attach a animated movieclip onclick to the button and when pressing another button, it swifts to that button.

Code:

var tracktype:Array = new Array;
var imgArray:Array = new Array;
var links:int;

[code]....

But Now the problem is that when another button is clicked I have to add the listeners back on the button, but I cant get the button because they all have the same name. Same with addChild the animated movieclip. Can't remove it. The buttons have a variable name, and can be unlimited.

View 8 Replies

IDE :: Buttons To Switch Between Clips?

Jun 26, 2009

I need to include a swf file on my client's web page. The swf file includes 4 movie clips appearing one by one. Each clip links to their designated page. I want to have small buttons to let viewers to click and switch to the clip they want. When click, the still shot (may be the last frame) of the clip appears. [URL]

View 4 Replies

ActionScript 3.0 :: Using Buttons To Switch To Different Scenes?

Dec 8, 2009

I am working in CS4 and am trying to use AS3.0 to make buttons that go to different scenes. I am not using "Scene 2" in my AS; instead, I am labeling frame 1 of Scene 2 and am using that frame label in my coding.
 
Unfortunately I cannot get it to work properly. I am about 8 hours into trying to fix it and cannot seem to get it resolved.
 
I have attached the .fla file for your reference. I have also pasted my AS coding below in case it is a simple thing (probably not!). The movie needs to stop at a certain frame so the buttons are available for the users. 
 
stop();
btn2_btn.addEventListener(MouseEvent.CLICK, showimage);
function showimage(event:MouseEvent):void {

[Code]....

View 2 Replies

ActionScript 2.0 :: Buttons To Switch Between Clips?

Jun 27, 2009

I am new to this forum. Not an experienced Flash user. I need to include a swf file on my client's web page. The swf file includes 4 movie clips appearing one by one. Each clip links to their designated page. I want to have small buttons to let viewers to click and switch to the clip they want. When click, the still shot (may be the last frame) of the clip appears.

View 0 Replies

ActionScript 3.0 :: Buttons To Switch The Visualiser On And Off?

May 8, 2011

I have a script that creates a music visualiser from audio that is played. I have a buttons to switch the visualiser on and off. On works Fine! but when i click to switch it off, the visualiser is still there.My script is below. Can anyone see what im doing wrong here?

ActionScript Code:
function playMusic(e:MouseEvent):void {
myMusic = new Sound();
if(channel) channel.stop();

[code]....

View 0 Replies

ActionScript 3.0 :: Get Button To Switch Out From Loaded Swf

May 18, 2011

I'm a designer struggling to learn advanced actionscript. It's quite a challenge,
One of the challenge i'm having right now is: I have my main timeline(swf). i'm loading in 2 separate swfs into two separate holders on the main stage/timeline/swf. whatever it's normally called. One of the loaded swfs is a menu and the other is a page. Basically i'm designing a learning application. The menu alllows you to jump to a specific place in the course rather than a next button of sorts which is also in the course.

When a different page is loaded i need for a button(movieclip) that's located in the menu swf to swith out with a new button that's located off the stage somewhere.(these buttons are located in the menu swf off stage) so i need the loaded page swf, to talk to the other loaded swf(menu) everytime it or another page is loaded. I've seen simular references to having a loaded swf talk to the main timeline swf but i haven't been able to find a reference for two loaded swfs thats loaded inside holders, to talk to each other.

View 1 Replies

ActionScript 2.0 :: Switch Between The Loaded Movies?

Apr 16, 2005

i load external movie with loadMovie action.

It loads the SWFs into the movie correct.

I have problem, how simply switch between the loaded movies. The last loaded movie overlay all loaded movies.

How is possible do it the swap of the loaded movies?

View 1 Replies

ActionScript 2.0 :: Assign Same Switch Statement For Two Different Buttons

Jul 13, 2008

Is there an efficient way to assign the following switch statement to two different buttons (movie clips)?

[Code]...

View 3 Replies

ActionScript 3.0 :: Automatically (fade In And Out) As Well As Being Able To Be Prompted To Switch Via Buttons?

Jul 12, 2010

I'm working on a slide show which I would like work automatically (fade in and out) as well as being able to be prompted to switch via buttons... I know this is a super simple thing, but I cannot get all the buttons to work. The buttons are copies of the same instance with different instance names and are located at the 3 respective frames in timeline where the pieces of slideshow should fade in/out ( I hope this makes sense) I get the first set of buttons to work:

import flash.events.MouseEvent;
controls.bttn1.addEventListener (MouseEvent.CLICK, clickSection1);
function clickSection1 (evtObj:MouseEvent) {
// trace shows what's happening in the output window

[code].....

but when I add more buttons that are located later on in a timeline, I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at INDEX_TEST_r3_fla::MainTimeline/frame1()

View 5 Replies

ActionScript 3.0 :: Flash Loaded Variables Breaks Switch Statement?

Jul 19, 2010

I've got a little script that scales a video to the stage. The scaleing function has a switch statement to indicate what kind of scaling to apply.If I declare the case value of the switch statement internally all is fine. However if I load this value from an XML doc, even though the trace indicated the value has loaded, the switch never fires.

Code:
/stage variables
var sH:Number;
var sW:Number;
var _contentHolder = new Sprite();

[code]....

View 2 Replies

CS3 :: Create A Different Object Of The Same Variable Name With The Switch Statment?

Oct 20, 2009

I just started in as3 after a long break from flash and I have run into a slight problem and couldn't find any readily available solutions online so I thought I'd ask, I'm trying to do something like this:

Code:

switch(characters[ps[1]])
{
case 0:

[code]....

I want to create a different object of the same variable name with the switch statment but it gives me "1151: A conflict exists with definition player in namespace internal" which is of course because I'm redeclaring the variable. I'm not 100% sure it technically exists in the current scope though (but it must because I am getting this error.) I also tried a few ways of initializing as just MovieClip up topside and then just try and typecast it down here but as can be assumed that didn't work either.

Is there a way to get my intended effect or am I gonna have to make some like an above class containing all these other classes on it's various frames and just instantiate those?

View 3 Replies

ActionScript 3.0 :: Create Something To Switch Vehicle On A Flash Game?

Sep 6, 2011

I know how i can create a button but how do i make it activate different vehicles before the race starts.

View 5 Replies

Media Server :: Use NetStreamPlayTransitions.SWITCH To Create A Multi Angle View That Switches Between Video Streams?

Feb 21, 2010

Hi,I'm trying to use NetStreamPlayTransitions.SWITCH to create a multi angle view that switches between video streams. The issue I'm having is that NetStream.Play.TransitionComplete is called only after the buffer for the video before it is used up(this makes sense when using SWITCH to go between bandwidths but that's not what i'm using it for). Is there a way to force this switch before the buffer of the previous video is used up?
 
I've looked into SWAP but I can't really find any documentation on it. What I ideally would have happen is the next video in the array is triggered, that video is buffered and when there is enough to play it the stream switches to that one. SWITCH works really nice because there is no jump in switching when it's played but I just don't want the buffer to play out before the switch.Is there a way of maybe clearing the buffer of the playing video before i call SWITCH so it transitions quickly?

View 4 Replies

ActionScript 3.0 :: Switch / Case And Nested Switch / Case

Oct 30, 2011

What I'm trying to do is create a program that, depending on 2 variables, multiplies another variable by a static number. Heres the code I have so far:

[Code]...

View 1 Replies

ActionScript 2.0 :: Can Default From Switch/case Be Used In Another Switch/case

Dec 10, 2003

I want this on an MC:

[AS]
i = 0;
switch(thing){
case 0:

[code]....

Basically what I'm wondering is, will I lose the value of i in the first switch once I'm out of the switch? Can the second switch read the 1st switch?

View 8 Replies

ActionScript 3.0 :: Switch/Case And Nested Switch/Case?

Oct 29, 2011

Im trying to create a program that, depending on 2 variables, multiplies another variable by a static number. A friend suggested I use case/switch instead of if/else statements,which is what I was using before.

[Code]...

View 1 Replies

ActionScript 3.0 :: Communicating To Buttons In A Loaded Swf

Jun 13, 2009

I am using the following code to try to reference these buttons "withing" my loaded content - itis giving me the following error:
 
TypeError: Error #1010: A term is undefined and has no properties. at sliSiteFinal_2_fla::MainTimeline/prevOut()
 
code:
 
pPrevH.addEventListener (MouseEvent.MOUSE_OUT, prevOut);
function prevOut (e:MouseEvent):void{    var mc:MovieClip = MovieClip(imageLoader.content);    mc.btn_prev.gotoAndPlay ("pLout");
 
Is my dot syntax here off? As it seems I am defining prevOver and it is telling me I am not.

View 4 Replies

ActionScript 2.0 :: Buttons Do Not Work When SWF Loaded In Another

Aug 29, 2009

I have a swf in which I load another swf, but when I do so, the buttons to enlarge a picture (large_btn) or to pause (pause_btn) or start (start_btn)the slideshow won't work. When I test the last swf only, everything works normally.

The code is in an AS-file.
Here's what I got sof ar:
ActionScript Code:
//Buttons
_root.large_btn.onRelease = function() {
var enlarge;
var frame = mainloader_mc._currentframe;
[Code] .....

View 0 Replies

ActionScript 2.0 :: XML-loaded Footer Buttons?

May 2, 2007

I hate doing this, but am not sure what else to do at the moment. The following code is supposed to read the label and url from an xml file and put that info into dynamically-created text boxes on the stage that the user can click on to navigate a website:

Code:
#include "mc_tween2.as"
var fontAssign:TextFormat = new TextFormat();

[code]......

View 2 Replies

ActionScript 2.0 :: Dynamic Loaded Buttons Won't Work

May 15, 2010

I try to make a dynamicly loaded menu.I load four buttons to the stage and applie code to each of the buttons. But it's only the last button loaded, that responds to onRollOver/onRollOut If I roll over the other buttons it's the last buttons that reacts all the time.I just can't see what's wrong. Here's the code:

Code:

buttonCount = 4;
for (var i:Number = 0; i<buttonCount; i++) {
btnRef = "button"+i;

[code]....

View 1 Replies

ActionScript 3.0 :: Disabling Buttons Of All Loaded Movies

Mar 9, 2009

So lets say if you three movies loaded on the stage on top of each other and if I want to disable the buttons for all the movies that under the very top one so this way user is only able to click on the button of the very top loaded movie.

View 1 Replies

ActionScript 3.0 :: Buttons Accessing Loaded Layers

Apr 2, 2012

Using Flash CS3 and AS3 to build a learning module that will load different layers of SWF files based on buttons on the main screen. Got this working with no problems. What I want to do is add buttons to provide learners some functionality, specifically a forward button, back button and a check box that will keep advancing automatically. I've done massive searches and so far nothing seems to work. Seems like what I am acccessing so far is the main layer, not the new layers as they are loaded. Below is what I have been trying with the back button; the foward button uses nextFrame and is Handler2. It isn't working. Not even sure how to start with the checkbox for auto advance.

[Code].....

View 5 Replies

ActionScript 2.0 :: Controlling External Loaded SWF With Buttons

Nov 23, 2009

Can we control the external loaded swf with buttons created on another swf. Let me simplify this: I have one swf in which I have created one small timeline animation and the second swf has the buttons to play and stop the animation.

Now I load this 2 swf in my main file and want to control the animation through that buttons.

View 1 Replies

ActionScript 3.0 :: Accessing Buttons On Externally Loaded SWF

Feb 22, 2012

I have loaded an external swf into loaderTopBanner. It works to manipulate that, but not the individual buttons within it. (e.g. btn_Home, btn_Info)
loaderTopBanner.btn_Home.alpha = 0;

View 2 Replies

ActionScript 2.0 :: Dynamic Loaded Images As Buttons?

Jun 16, 2005

loaded images dynamiclly in my flash movie and now i want to make them behave like buttons. I mean, I want [onRelease] function to work. I am sure i am doing something wrong because i cannot make it work.

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved