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
Similar Posts:
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
Feb 1, 2010
i have common trouble with buttons. I have the map of county, divided to a regions. And if i rool over on the button (region) with AS2 calling animation some region. Problem begin if i need one animation on stage with information strip on top level and i need hide this strip if roll over on all stage. But not played animation in the regions.
View 4 Replies
Aug 11, 2009
I have a cascading/collapse flash menu.There are about 7 layers, each one of them a different page that slides and covers the other layers.for some reason, all the buttons on the bottom layer (layer 1 for instance) can be clicked on even when the 6 other layers are ontop of it with their own links and buttons. How can I make it so all my buttons don't shine through all the other layers. I can't slide the layer away to get ride of the buttons because it is still partially viewed when the other layers are ontop of it. I can't figure out why the buttons in layer one can be clicked in layer 2 when its on top of layer 1, or layer 3,4,5,6,7 when they are on top of layer 1-i assumed these layers would block out the buttons and links in the first layer(which is on the way bottom)
View 2 Replies
Jun 6, 2005
Here is the code that I am using for my button
on(release){
loadMovieNum("CG/images/houseGroups/1fs.swf", i);
i++;
}
And then on the first frame of the timeline I am putting i=10
So every time the button is clicked it keeps loading on top of the last. This all works fine. My question is: How do I unload all of the layers that have been loaded. It seems like it should be an unload i< but that does not work.
View 2 Replies
Dec 7, 2009
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 reveal 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. 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.
My file at the moment is in AS2... 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... The attached fla is an example of mine animation the right buttons are the red ones.
Attachments:
example.swf (14.1 K)
example.fla.zip (269.8 K)
View 1 Replies
Jul 27, 2011
I am trying to create a Flash website that with multiple pages. Each page has input text areas to collect a number of something. I would like to do the following :
Have multiple pages that keep the user's input data as they navigate back and forth between pages Allow the user to hit a simple "calculate" button to take the kept information on each page and show the end calculation of the entered data on each page on the main stage or page.
I would assume that to keep input information intact, the pages would all have to reside in FRAME 1 where the actionscript is kept and the main guts of the calculations occur. So, is there a way to make a multi-page website in Frame 1 only using only multiple layers where the page buttons simply only go to another layer rather than page. Or, can I create a multi-page website over many frames, keep the user entered data intact while navigating to each page and propigate/calculate that data when the user hits the "calculate" button on the main page?
View 1 Replies
Oct 22, 2009
I have created a button which contains a movie for each county, when a user rolls over it pops out and displays a list of names. The problem I have is each button is on a layer and when you roll over the bottom button it's hidden below the others. Is there a script to bring each layer to the front automatically? I'm new to flash so if possible could you please explain in layman's terms.
View 6 Replies
Aug 10, 2009
I'm using a really simple bit of code on some fading in/out buttons which overlap each other slightly to ensure that the one with the cursor resting over it sits in front of the others:[code]problem being that this brings the button in front of everything across all layers. How do I change my swapdepths to make sure the layers above the buttons STAY above? - or do I need to add something to the other layers to give them a fixed 'depth'?
View 11 Replies
Sep 24, 2006
i'm trying to make a website in a number of buttons and layers. In one section i need to have an if statement on the buttons as where in the timeline they go is dependant on where the user is (this location is set in a variable called "destination".
The problem is that when i have = in the if statement it bypasses the first section and only does the else action (ie trace ("else")), and if i put == in the statement it only does the first action (ie trace ("gallery")) no matter what "destination" is.
here is my code:
on (release){
if (destination = "gallery"){
trace ("gallery");
}else{
[code]....
View 9 Replies
Jan 19, 2010
Situation: I have a project I'm working on where I have buttons which make click sounds on their own, and also take you to other scenes where a sound will immediately play. There are also three movieclips involved, total my base movieclip and two independent ones that load on top of that. Problem: I want to include a Mute button so that you can turn off all sounds, but can't figure out how to do that..As I understand it, stopAllSounds won't work for me, because as soon as someone hits another button, a new sound will play.
View 5 Replies
Jan 11, 2010
I'm trying to do a presentation of some Adobe Illustrator graphics in flash for an architectual presentation. I want to zoom in on some content and have new layers fade in and out. I guess this is done by tweens, as I had som succes in that direction.The problem becomes obvious when I want to control my presentation. I want to set cue points/keyframes/whatever so that the presentation will start at the click of a 'next button' or a click og the mouse. Then I want it to stop at some point when the tween/moving around of objects is done, so that I have talking time before playing the next tween with a click etc.
View 3 Replies
Aug 1, 2011
I want to create multiple layers where each layer has some graphics and buttons on it. I am using Flex so I like to do this using actionscript.
Does anybody know how to create a layer in actionscript?
How do you attach these layers to your stage?
View 4 Replies
Feb 25, 2011
-this is supposed to make multiple buttons with text(not clickable yet) -it seems to coppy over, or remove the previous myButtons[i] movieclip each time it goes through the loop. -there are 3 strings in buttonText.length -on the output i get 0,1,2 -but on the screen I only see one gradient (its only a pink box, but one problem at a time) -the box appears where roughly the 3rd button should be. -full code attached
View 14 Replies
Sep 10, 2005
the snow effect always acts like the top layer, ok what i mean is, i have 3 layers, (1)toplayer= a car, (2)middle= snow, (3)low= background.I want to make the snow to be seen behind the car...i hope you understand what i mean , whenever i put the code from the link above it acts as the top layer and appears in front of everything.
View 4 Replies
Jun 1, 2011
I'm using this code to bring in another swf into a movieClip called "movieLoader":
var myLoader:Loader = new Loader();
movieLoader.addChild(myLoader);
var urlMovie:URLRequest = new URLRequest("movie1.swf");
myLoader.load(urlMovie);
The movie loads just fine, but how do I access it?
I tried:trace(movieLoader.totalFrames);
and it just gave me "1". I know the movieclip has more than 1 frame.What do I do to access the swf called "movie1.swf" I just brought into that movieClip?
View 4 Replies
May 20, 2011
I'm loading an external AS3 SWF using the Loader class but i need to access a method inside the loaded SWF. how can i do this?
View 1 Replies
Oct 13, 2010
So I want to access another loaded SWF. How can I have ChildA talk to Child B? All are external SWFs.
[Code]...
View 1 Replies
Aug 24, 2010
My problem is that I created my buttons on the stage and then grouped them together as a movieclip called navSat.Then I set the Linkage for navSat to NavSat.I am doing all my coding through AS3 outside of this. This is my code:
Importing the NavSat MovieClip
Quote:
function loadNavSat():void {
var newNavSat:MovieClip = new NavSat();
addChild(newNavSat);
[code]....
When I run the swf now, my navigation system comes in and all the buttons are working (up, down, over, off states are working) It still links to nothing yet. The problem is when I try to add functionality to those buttons. I have tried about 5 days worth of variations around this type of code but cannot 'communicate' with the buttons within the movieclip. This is my code for the 1st button - contactBtn (linkage: ContactBtn):
Quote:
contactBtn.addEventListener(MouseEvent.MOUSE_DOWN, contactDown);
function contactDown(event:MouseEvent):void
{
[code]....
View 1 Replies
Feb 12, 2009
I'm trying to organize a presentation using several movieclips as "scenes." The problem I have is related to buttons nestedwithin those mc's--I would like them not to be available until eachindividual mc begins, but if I don't include the buttons on thefirst frame of the mc timeline, the main timeline cannot accessthem (and throws me an error)
View 8 Replies
Mar 31, 2012
I've recently started development on my first proper AS3 project and I�ve hit a sort of brick wall with my knowledge of how to make AS3 classes do what I want. I could do this in AS2 no problem with referencing the stage, but now that only the document class has access I'm stuck.I have instances of a MC called activity. These sit inside a container MC that is the source of a scroll pane (that sits on the stage).
When I click a button inside the Activity MC I need to generate a new MC and set that as the content of another scroll pane on the stage. I�ve tried several things, even gotten the stage passed to the activity MC class but it can't then be used to addChild to items on the stage just reference then (much to my aggravation). And I can�t set an event listener for the new activity�s button when it�s created as it throws a static display object error of some sort.What methods can I use to pass information from a MC class back to the stage so i can call a function or just paste a MC onto the stage? I'm at my wits end after about 10 hours of exhausting everything the internet seems to have to offer on the subject.
View 2 Replies
Mar 30, 2009
I am using a zoom component which i purchased recently to load different external swfs on different button clicks. But instead of loading separate external swfs I would like to load a single swf and go to frame labels - "one", "two", etc. - I've been reading about casting the external swf as a movie clip, but I am confused how this would work with the code I have at the moment.
var image:String="introlocal.swf";
function loadContent () {
var myLoader:Loader = new Loader();
[code].....
View 1 Replies
Jan 6, 2009
finding the url of the swf filefrom which it has been loaded? The purpose of the url is, I amloading some flv files using relative path. I just want to achievethe same by appending the relative path to the parent swf url fromwhere the parent was loaded. I am a newbie to AS3
View 5 Replies
Sep 15, 2008
I have a problem accessing a variable loaded from another swf. Actually the variable is a singeltone class, which needs to be initialized.It has structure presented in the last part of the message.The project has the following structure:
- main.swf - this loads all the other swf files and is their holder.
- assets.swf - contains some common elements and initializes the SingleTone class
- interface.swf - contains some interface elements and needs to use the SingleTone class
- all the three swf files have access to a common class structure, where the SingleTone class is defined.
Now, the problem I have is accessing the SingleTone class from the interface.swf file. If I try to send the SingleTone.singleTone. property parameter to the class I get "Type coercion failed: cannot convert from ClassName@.. to ClassName". If I try to access the SingleTone class directly from the interface.swf file i get "Cannot access a property or reference of a null object...". Both errors I get seem logical:
- if I send a parameter, I send the reference to that object, but the interface.swf file does not have access to the assets.swf domain;
- if I try to access the SingleTone class directly from the interface.swf file, I get the null error because the class is not initialized over the interface.swf domain.
Is there any work arround? I know a simple solution may be to initialize the variable over the interface.swf domain, but what if there is a variable that can only be instantiated in the assets.swf? Can I access that variable from another swf, or can I change the ApplicationDomain?
View 1 Replies
Nov 14, 2010
I am trying to load swf file with Loader class into AIR application. The broblem is that the loaded swf can not access web cam (it can when I run it standalone). Is there any security settings I have missed.
AIR loader code:
loader = new Loader(); loader.name = "moduleLoader";loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
[Code]....
View 3 Replies
Nov 23, 2011
In Flash Professional, I drew a shape, converted it to symbol, linked it to class Symbol1 (extends MovieClip) which is generated at run-time, and saved the SWF file as shape.swf.
Now my main application wants to load shape.swf and create multiple instances of Symbol1 but I get ReferenceError when trying to access the class Symbol1.
Below is my main application's code. Errors thrown are mentioned in comments.
public class MovieClipTest extends Sprite
{
public function MovieClipTest()
{
[Code]...
View 11 Replies
Mar 4, 2012
I have a SWf application built in flex 4. One part of the application relies on accessing a public variable ("step1") set at the application root, and is accessed with
var app:Object = FlexGlobals.topLevelApplication;
trace("step one is "+app.step1);
This, while not optimal, has worked fine. Now, hoever, I need to load this entire application into another application, and I can't figure out how to access my step1 variable any longer.I have been loading the swf into the new parent application like so:
public var myLoader:Loader = new Loader();
public var pizzaContainer:UIComponent = new UIComponent();
private var myUrl:URLRequest = new URLRequest("chickensoup.swf");
[code]......
View 1 Replies
Jul 1, 2009
I am creating a flash program to open other flash programs (load swf files), and change their textfields to my own extended textfield class. This is to capture all text written to screen using a textfield object. Here is what I am doing:
1. If a textfield has been created, the event is captured
2. I want to replace the textfield with my own class extending textfield
*3. Any further access to the original textfield for value changes can be captured, and would update the replaced extended textfield object
The problem is if in their original code, at sometime, the text value of textfield is changed (mainly through textFieldObj.text = some_value) , I don't know how to capture this event.
This cannot be captured by event.CHANGE which requires the user input (ie: keyboard strokes) into the actual text field and changing the text through the code: textFieldObj.text = some_value does not trigger the event.
Here is a simplified example:
// FlashMovie.fla START -------------------------------------------
// any DisplayObjects (such as a created textfield) created will be captured
// by ChildAdded()
this.addEventListener(Event.ADDED, ChildAdded);
[Code]....
View 0 Replies
Jul 22, 2009
I have a movie called crime_scene.swf that is loaded onto another swf.
Code:
this.createEmptyMovieClip("myContainer", 1);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip)
[Code]....
It seems like it's not working. I tried just myContainer.evi_1.onRelease and _level1.evi_1 but nothing seems to work.
View 2 Replies
Jun 30, 2010
I have a file which loads a series of SWFs. It loads one, allows it to play to completion, then stops. Right now, it will just wait for the user to press a button and select the next one. However, I need it to play them sequentially. Is there any way for the SWFs which get loaded to access the functions which control the SWF loading?
View 4 Replies