ActionScript 2.0 :: Array For Naming Buttons And Loading Movies?

Nov 30, 2010

I've got about 50 buttons onstage with names like btn1a_mc, btn2B_mc, etc. Each one loads an external swf (called "Monosem1Aslideshow.swf", where the "1A" corresponds to the button name.) into a movieclip holder called slideHolder_mc. I'm trying to use an array instead of writing code for each button. I'm using the following:

Code:
buttonNumber = ["1A", "2B", "3C", "4D", "1E", "2F", "3G"];
for(i=0; i<buttonNumber.length; i++){
var btnName:String = "btn"+[i]+"_mc";

[Code].....

But I can't seem to get it to work. I'm a little shaky on array syntax and can't find a tutorial that addresses my particular problem.

View 12 Replies


Similar Posts:


ActionScript 2.0 :: Array For Naming Buttons And Loading Movies

Nov 30, 2010

I've got about 50 buttons onstage with names like btn1a_mc, btn2B_mc, etc. Each one loads an external swf (called "Monosem1Aslideshow.swf", where the "1A" corresponds to the button name.) into a movieclip holder called slideHolder_mc. I'm trying to use an array instead of writing code for each button. I'm using the following:

Code:
buttonNumber = ["1A", "2B", "3C", "4D", "1E", "2F", "3G"];
for(i=0; i<buttonNumber.length; i++){
var btnName:String = "btn"+[i]+"_mc";

[Code].....

But I can't seem to get it to work.

View 7 Replies

IDE :: Keep Buttons From Loading External Movies?

Nov 5, 2009

I got this tutorial about external movie loading. It works but it seems that their is a little problem with it. How do you keep the button from loading an external movie once it's loaded already?

[URL]

Let's BUTTON-1 loaded MOVIE-1, now when you click on BUTTON-1 again it will load the movie even if it's loaded. How do you do it like only when another button is clicked will it load the movie for that button.

View 2 Replies

ActionScript 3.0 :: Loading Movies From Library According To Array

Mar 16, 2011

I have 5 movies in my library, called question0, question1, question2, question3, question4. I linked them with export for actionscript. I have an Array, called questions. Then I have a button that calls the getQuestion function. But I get the following error:

[Code]....

View 2 Replies

Array's And MovieClips - Use The Naming Conventions Of An Array?

Nov 18, 2009

I received help on this site on this info-graphic im doing and the solution was to use an "array" which im not familiar with at all. the person that helped me added the following code that worked:

var city_arr:Array = new Array("louisville");//filll that array with all nedded cities//make all the boxes invisible at startfor (i=0;i<city_arr.length;i++){    var [code]...

since i dont know how to use arrays im stuck. i need to add at least 30 more cities to my info-graphic but don't know how to use the naming conventions of an array.Only one of the houses works (when you click on it a pop-up appears, is draggable and has an x to close the pop-up)

Attachments:
relocation_working.fla.zip (975.1 K)

View 1 Replies

ActionScript 1/2 :: Sound Linkage When Loading Movies Into Movies?

Jan 16, 2007

I have an intro.swf file that is basically a movie with sound that is exported for actionscript but not exported in the first frame. I just stuck it in a movie on my timeline and it works great and the preloader works because it doesn't load the sound before the preloader. I use :

musicSound = new Sound();
musicSound.attachSound("music");
musicSound.start();
to play the sound in intro.swf.

However, now this intro.swf gets loaded into an index.swf and everything works fine and the sound plays as long as I have the sound included in BOTH the intro.swf and the index.swf and the sound is exported on the first frame in the index.swf. I was hoping I could remove the sound entirely from my index.swf since it already loads into the intro but so far

View 9 Replies

Actionscript 3 :: Naming The Buttons Components?

Apr 2, 2012

How to name through AS3 buttons components?I have 3 buttons components: a BackButton, a ForwardButton and a PlayButton.I have named them through the properties panel, (where it says 'Instance Name').But once I click on them and check for event.target.name I receive, always 'button_mc'.How could I name the buttons?

View 1 Replies

AS3 :: Way To Array Index Naming

Mar 11, 2010

I thought that there was a way to be able to name array indexes. Like instead of myArray[0], it could be myArray["tileFour"]. I thought that instead of using index numbers one could use index words.

View 1 Replies

ActionScript 3.0 :: Naming Children In An Array?

Jan 4, 2011

I made a thread a couple days ago, but dont think i explained the problem well enough. What im trying to do is name each of the children.

Child 0 = A
Child 1 = B
Child 2 = C

all the way to Z. Then start at A again.

ActionScript Code:
function moveBubble(Event) { // This function handles the movement of the bubbles
if (!inPlay) return;

[code]....

View 7 Replies

ActionScript 2.0 :: [FMX] Naming The Mcs From An Array With AttachMovie?

May 9, 2010

I'm creating some mc's on the stage with the attachMovie function in a loop. I have no problem naming them like that:

foo.attachMovie("myClip", "myClip"+i, 200+i);

But I need to name them with part of an array like that:

foo.attachMovie("myClip", "myClip"+array[i]+"_mc", 200+i);

I thought that would work but I guess my synthax is wrong. How do you mix strings and arrays elements inside the () of the attachMovie?I need to get something like: myClipArrayElement1_mc for the name of the attached movies...

View 2 Replies

ActionScript 2.0 :: [FMX] Naming The Mcs From An Array W/ AttachMovie?

Nov 28, 2002

ok, that's some basic question but it's 4 am, I can't find the answer in the tutz and I'm starting to get a headache...I'm creating some mc's on the stage with the attachMovie function in a loop. I have no problem naming them like that:foo.attachMovie("myClip", "myClip"+i, 200+i);But I need to name them with part of an array like that:foo.attachMovie("myClip", "myClip"+array[i]+"_mc", 200+i);I thought that would work but I guess my synthax is wrong... How do you mix strings and arrays elements inside the () of the attachMovie?

View 6 Replies

ActionScript 2.0 :: Dynamic Object Naming From Xml In Array?

Jan 20, 2009

This is the object array target structure I am looking to create

myObject.myArray[0].data=value;
myObject.myArray[0].data2=value2;
myObject.myArray[1].data=value;

[Code]....

View 2 Replies

ActionScript 3.0 :: Naming Movie Clips In An Array

May 11, 2010

In this code I created an array and am placing instances on the stage when I click on buttons relating each movie clip.

[Code]...

View 3 Replies

ActionScript 2.0 :: Call All Buttons Within A Certain Movieclip (without Naming Each Instance Individually)?

May 21, 2008

how can i call all buttons within a certain movieclip (without naming each instance individually)?

View 5 Replies

Actionscript 3 :: Multidimensional Array - Loop Of Buttons And Loading Swf/img/txt From Xml

Sep 17, 2011

Okay, here goes: What I'm trying to do is create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked. What I don't understand is how to pull the swf or image file from the file like I have with the text. Truth be told, I'm completely lost and could really use some help fixing this. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.

[Code]...

View 1 Replies

Buttons Always Appear Visible In Nested Movies

May 19, 2009

I created a button in one movie. I nested a second movie that is the same size as the first movie. In the second movie I can successfully hide an object in the first movie with an object in the second movie. However, I can't prevent a button in the first movie from being shown in the second movie.

View 1 Replies

ActionScript 3.0 :: Movies (as Buttons) Reacting To Each Other?

Feb 20, 2009

Attached is my movie. It will have multiple buttons with rollover states. My question is...

I would like to press "button1", have the mc play (as it is doing). Then press "button 2", and have "button 1's" mc go in reverse OR play out as if it has left the stage. Not just suddenly vanish. There will be multiple buttons, not just the 2.

View 5 Replies

ActionScript 2.0 :: Roll Over Movies As Buttons?

Mar 14, 2004

I've created movie clip, in which when you Roll Over it, it will load another movieclip within that frame which will display the menu (and in there are the buttons that link the scenes together).how do I get the movieclip that is within a movieclip, that is again in another movie clip to link to the next scene? Can it even be done with one of the movie clips asking as a roll over?

View 5 Replies

ActionScript 2.0 :: [FMX] Roll Over Movies As Buttons?

Mar 14, 2004

I've created movie clip, in which when you Roll Over it, it will load another movieclip within that frame which will display the menu (and in there are the buttons that link the scenes together).

My question is, how do I get the movieclip that is within a movieclip, that is again in another movie clip to link to the next scene? Can it even be done with one of the movie clips asking as a roll over?

View 5 Replies

ActionScript 2.0 :: Assign Movies To Buttons?

Aug 9, 2002

how to assign movies to buttons. I don't know how to do this in MX. In five I used to use tell targets to assign actions. Is it the same in MX.

View 5 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 2.0 :: LoadMovie - Buttons Won't Load The Movies

Nov 8, 2003

I am working with Flash MX. I am creating a site with a Main.fla which contains buttons to load other SubPage.swf files. For example, I have a Page1 button with the following actionscript code.

on (release) {
_root.contents.loadMovie("page1.swf");
}

It works fine. Now when I work on the Page1.fla, I am trying to load other Movies in the same fashion. It works when I CMD+RETURN to generate the .swf file. However when I CMD+RETURN the Main.fla file and load the Page1 file, the buttons won't load the movies. Is this a Target Path issue? How would I remedy this?

View 4 Replies

ActionScript 2.0 :: Incrementing An Array Of Movies?

Jun 13, 2005

I'm trying to create a spinner for different ads for an advertising company website. Each ad has a name, such as "out" "pie" and "bigger". All of them are turned off except "pie" to start off with:

Code:
//initialize movie
var itemArray:Array = new Array();itemArray[0] = out;
itemArray[1] = pie;
itemArray[2] = bigger;

[code]....

The thing is, I can' figure out the button script to cycle through this array. I want to click a forward and back button, lets use forward for now, and do something like (don't mind the syntax):

Code:
on (release) {
i+1, remember the spot, and make everything else invisible.
When you click again, you increment to the
next ad/instance name and so on.
}

What is the actual syntax for this?

View 3 Replies

ActionScript 2.0 :: From Buttons Playing 2 Movies That Display Text

May 13, 2010

I am creating a website that teaches kids about the about the brain and I am creating a website very familiar to this one, [URL]. I created one flash file and drew the background for where the text will display. Next I created several movie clips for each of the brain parts and I placed an invisible button over each of these movies, e.g., I told the button, "cerebellum_button" to play the movie "cerebellum_mc." which includs text.

I feel that my code is redundant because I am having to create an invisible button for each animated movie clip which plays a movie clips with text. Is there a way that I can centralize all of the text in the project then call it from different buttons? My aim is to have the user roll over the brain part, have it animate, and have it display the text that explains what that brain part does.

cerebellum_button.onRollOver = function(){
cerebellum_mc.gotoAndStop("turnon");
} cerebellum_button.onRollOut = function(){
cerebellum_mc.gotoAndStop("turnoff");

View 0 Replies

ActionScript 2.0 :: Use Variables (on The Buttons) To Control External Movies?

Oct 14, 2002

I have a movie which is made up:

Level0= my interface layout with buttons

Level1= the different sections of the site, are loaded into this level (eg. home.swf, aboutus.swf etc.)

Because each of these sections has both an 'in' and 'out' transition, i want to use variables (on the buttons) to control these external movies that are loaded into the main movie (im even starting to confuse myself

basically in a nutshell... can you use buttons which control a movie ,which has been loaded at another layer, using variables....

View 1 Replies

Loading External Movies Or Not?

Oct 31, 2009

I have always the argument with my colleagues which authoring strategy to use. I always attached to the idea of authoring several swf files, and have them all loaded to the main swf when needed. And than attach Preloader to each swf that I load.
 
Others think that it should be only one swf with one preloader. And have all the navigation to use scenes or goto actions.
 
So the advantage of using my strategy is that users will not wait too long for one movie when its being loaded. And its more convenient to work on several fla with each have its own layers, symbols, etc

View 6 Replies

IDE :: Loading Multiple Movies?

Sep 21, 2009

I want to create a website having one main stage file(main.fla) with different swfs(movie1.swf, movie2.swf,movie3.swf) for various sections. Am not sure what I am doing wrong here but somehow when I click the button it does not load the respective flash file

View 6 Replies

IDE :: Loading Movies From Different Levels?

Oct 1, 2009

I am creating a presentation which has a main flash and then 3 sub categories to it. Main.fla is nothing but a container to load the other movies into. I could get the the first movie (movie1.swf) to load onto main.swf by using the foll code:

this.createEmptyMovieClip("empty_mc",1);
empty_mc.loadMovie("movie1.swf");
empty_mc.x=0;
empty_mc.y=0;

Now the problem is in movie1.swf the menu is like on the 3rd level, i.e. main stage>menu_mc>menu (where the buttons are).

How can I add a code on level "menu" so that when I click button2 or button3 it loads movie2.swf and movie3.swf respectivley onto the main stage. Makes sense or am making it too confusing..

I want to try this breaking a big movie into smaller parts functionality so that I can understand flash more.

View 1 Replies

ActionScript 1/2 :: Scripting External Movies To Buttons In Main Movie?

Apr 19, 2009

I'm building an entirely flash based website using Flash CS3 and ActionScript 2. I'm using external movies for the various pages, and putting buttons that control these movies in the main movie file. Normally, I'd simply put the script to control the buttons on the main movie file, not the external ones, but because there's more than two different pages and I'm fading each external clip in and out, I'm wondering if possible to put the script, for the buttons on the main movie, on the external movies.

View 15 Replies

ActionScript 2.0 :: How To Stop Buttons To Show In Lower Level Movies

Jan 6, 2005

When you have movies in a layer, how can you stop the buttons of the underlying levels from showing through. I don't want the user to think that there is a button on the level showing because the cursor turns into a hand....plus also when clicked it does activate the lower movies actions.

View 1 Replies







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