ActionScript 3.0 :: 2 Buttons In An Array Using The Same Array Info?

Oct 23, 2011

I am trying to use two buttons in an array that use the same information in that array, so I'm trying to lump them together so I don't have to write them separately. This is what I've come up with, which doesn't work. One of the buttons works, but the other one doesn't:
 
var arrNavigation:Array = [{button:(n1_mcButton, n2_mcButton), page:bucktown, popup:popUp1, imgNumber:9},

n1_McButton and n2_McButton are two different buttons, but all the other information is the same.Is it possible to write this more efficiently than listing the buttons out separately?]

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Put All The Buttons In An Array And Then Use The Array Identifier To Add The Even Listeners?

Feb 1, 2009

im learning as3 and am trying to understand arrays so could an array be used in this situation i have 5 buttons which all need a ROLL_OVER, ROLL_OUT and CLICK mouse event is it easier to put all the buttons in an array and then use the array identifier to add the even listeners? or is there another way to do this? p.s if anyone can give me a few basic usages of arrays that you use in your experience. where to use arrays too

View 5 Replies

ActionScript 2.0 :: Reading Info Into 2d Array?

Dec 6, 2004

ve got a page "news.php?search=" outputting this: id1=1&titel1=owaaa&text1=content2222212&ort1=Tran s& id2=4&titel2=sadas&text2=test tesxt Aneby&ort2=Aneby& id3=9&titel3=titasd&text3=ingassdssadsdset&ort3=An eby Trans deshG&

this is just an example of a possible output. The output varies with what search criteria was given , there could be anywere from 0 to 400 hits, were they are listed in this way. now im wondering how i would get this into a two dimensional array in flash so that (array[row,column])

array[0,0]=variable id1, array[0,1]=contents of variable titel1 so the 4 variables are listed in horizontal manner and array [1,0]= content of the variable id2 and array[2,2]=contents of titel2 .

View 1 Replies

ActionScript 2.0 :: Reading Info Into 2d Array

Dec 6, 2004

ive got a page "news.php?search=" outputting this:

id1=1&titel1=owaaa&text1=content2222212&ort1=Tran� s&
id2=4&titel2=sadas&text2=test tesxt Aneby&ort2=Aneby&
id3=9&titel3=titasd&text3=ingassdssadsdset&ort3=An eby Tran�s �desh�G&

this is just an example of a possible output. The output varies with what search criteria was given , there could be anywere from 0 to 400 hits, were they are listed in this way. now im wondering how i would get this into a two dimensional array in flash
so that (array[row,column])

array[0,0]=variable id1, array[0,1]=contents of variable titel1 ... and so on..
so the 4 variables are listed in horizontal manner and array [1,0]= content of the variable id2 and array[2,2]=contents of titel2 ..a nd so on ..

View 1 Replies

Access Child Movieclip Info Of An Object In An Array?

Nov 28, 2010

I've dynamically created a whole bunch of movieclips.

I've given each clip a name based on a variable number:

mc.name = "mc"+i;

I've also use addChild to add a couple of dynamic text fields to each movieClip, named myText1 and myText2.[code]...

View 3 Replies

ActionScript 2.0 :: Multidimensional Array - Product Info MovieClip

Mar 14, 2004

Here's my scenerio: in my product info MC, user can select from 4 categories which gotoAndStop a nested MC. Each of the 4 categories has 5 hit areas on an "imagemap". The problem that I'm running into is that on each of those hit areas (mc's), I have actionscript - so that's 5 x 4 of essentially the same actionscript. Only difference is text information and _x & _y co-ord's (code is for caption/images boxes) Could I store all that data in an array in the product info MC rather than having 20 blocks of actionscript??

View 5 Replies

ActionScript 2.0 :: Populate An Array With Info Loaded In From An Xml File?

Nov 27, 2006

I'm trying to populate an array with info loaded in from an xml file. I've got the xml loading fine and I can trace everything but cannot seem to access the info outside of the function...here's my code:

Code:
myXML.onLoad = function(success) {
if (success) {
populateNav(myXML);
} else {

[Code]...

My trace inside of the populateNav function works great...all the info is there and image_path returns all of my...image paths. So my XML is fine...what I can't seem to do is pass that info outside of the populateNav function. My imageholder trace returns undefined. I think it's got something to do with the fact that the imageholder trace is being performed before the xml is fully loaded...not sure what to do about that though.

View 2 Replies

ActionScript 2.0 :: Extract Info From String And Add Data To Array

Jun 6, 2008

I know
insideInput = String(xmlNode.childNodes[0].attributes.insider)
virusTarget = insideInput.indexOf("kz", [17]);
endTarget = insideInput.indexOf(".", [virusTarget+2]);
trace("VTTT"+virusTarget)
trace("ET"+ endTarget)
//endTarget = local.indexOf(".", ["vitesting"]);
clipTarget = virusTarget+3;
zebra = insideInput.substring(clipTarget, endTarget);
trace(zebra)
I'm trying extract info from a string, increment through it and add the data to an array. I can't get the startIndex thing to work.

View 2 Replies

ActionScript 2.0 :: Dynamic Slideshow - Loading Images Using XML Info From Array

May 25, 2009

I've constructed a dynamic slideshow using ActionScript 2.0 and PHP/MySQL. The reason for this, aside from update purposes, is that the slideshow will eventually display over 200 images. Thus, to save loading time and bandwidth, I decided to use PHP to pull ten images from an SQL database, formatting the output in XML. The slideshow itself works fine. Unfortunately, there are a couple of issues I need to address; my ActionScript is extremely rusty, so much of my work's patchy.

The code's displayed below:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("getData.php");
[Code] .....

The code in red is my main focus. It's the loop which loads all images as movie clips using the XML information from an array. The loop loads all of the images, making them transparent before the presentation begins. What I would like to do instead, to save loading time, is to load the next image while the current one is displaying. The function "moveSlide" controls the transition of the images, so I'd imaging it'd be best to plade it in there.

There's already an incremental variable being used, with _root.target_mc, for removing transparency from the current slide. The code in blue is also nagging me quite severely. I retrieve the next chain of slides by simply contacting the PHP script again. The only way I could think of doing that was to refresh the slideshow (this is done COMPLETELY in ActionScript, with nothing on the stage). Unfortunately, I could only work out how to reload the whole video.

View 1 Replies

ActionScript 2.0 :: Multidimensional Array - Storing Data In Product Info MC

Mar 14, 2004

Here's my scenario: in my product info MC, user can select from 4 categories which gotoAndStop a nested MC. Each of the 4 categories has 5 hit areas on an "imagemap". The problem that I'm running into is that on each of those hit areas (mc's), I have actionscript - so that's 5 x 4 of essentially the same actionscript. Only difference is text information and _x & _y co-ord's (code is for caption/images boxes) Could I store all that data in an array in the product info MC rather than having 20 blocks of actionscript?

View 5 Replies

Actionscript 3 :: Dynamically Insert Object / Array Info In A Dynamic Textfield?

Jan 25, 2012

I have a load of objects with arrays in them.

var tabData0: Object = new Object();
tabData0.tab1 = new Object();
tabData0.tab1.names = new Array();

[Code]....

I want to combine this output with a few more to refer to my object / array. The remoteHolder contains the value I need to know which object (tabData0, tabData1, etc) to retrieve the info from.

tabHolder['btn' + i].titleHolder.titleField.htmlText = all['tab' + tab].names[(i-1)];

But get this:

ReferenceError: Error #1069: Property tab1 not found on String and there is no default value.

View 1 Replies

ActionScript 2.0 :: Passing Info In Array To Dynamic Text Field On Rollover?

Aug 20, 2007

I am trying to pass information to a many dynamic text fields when rolling over various movieclips that are generated using a loop. I have tried everything I know but can not get pahting to work prpoerly. The rollover works in that the curser changes by does not execute the lines of code within the in line function.(see red, bolded text (towards bottom) for problem). the Attached zipped swf is what it looks like as is.

Code:
//how many floors are there in the building?
var floors:Number = 25;

[code].....

View 2 Replies

Actionscript 3 :: After Shuffling Array - Variable = Array[index] Gives 0, Trace(array[index]) Gives Correct Number

Aug 16, 2011

I think it would be simplest to explain it like this:

[Code]...

View 1 Replies

ActionScript 3.0 :: Buttons In An Array?

Feb 16, 2011

If I have a bunch of buttons in an array, each with an event listener, and a user clicks on one, how do I find out which the user clicked on?

[Code]...

The buttons appear on the stage, and I can click them. In buttonHandler, variable i always contains array size + 1 (in this case, 10). Since this is out of bounds, this doesn't work. I'm guessing it goes through the whole for loop first, and then starts adding event listeners with the newest i value, so this method doesn't work.

As for the function inside a function for the event listener, it's the only way i know how to pass parameters into functions from event listeners. I really don't want to not use an array because there are going to be a ton of buttons (well over 500).

View 1 Replies

ActionScript 2.0 :: Using An Array With Buttons?

Mar 26, 2007

I have six buttons on my stage and whichever one is pressed send the playhead to the framelabel respectively, this is the code

Code:
numOfBtn = 6;
stop();
for (i=0; i<numOfBtn+1; i++) {

[Code].....

But before it goes to the framelabel I want the playhead to play first and THEN go to the framelabel..Should I remove this line gotoAndStop("frm"+(this.num+1)); and add it further down the playhead? It doesn't seem to work

View 14 Replies

ActionScript 3.0 :: Put Buttons Into An Array?

May 28, 2009

Im workin with as3.. I've just created manually 10 buttons to wich i assigned istance names (btn_01,btn_02,btn_03, ecc...).

Now i wanna assign to them Mouse events for loading each one a different pictures when i rollover.

So i thought to put them in an array

bottoni:array=new Array();
bottoni [btn_01,btn_02,btn_03 ....];

but i think the value i put in the array (Example: btn_01) is not the istance name of my button already on the stage (cause when i say "trace bottoni[0]" the output is null)

View 7 Replies

ActionScript 2.0 :: Using An Array For Buttons On The Stage?

Jun 15, 2009

I'm familiar with using arrays with for loops, where the buttons are created dynamically.However I'm building an application with calendar month grids, where maybe half the dates are clickable. How would I use an array to address these buttons so I don't have to write code for each individual button? Or is there a better way than using an array to keep my code as simple as possible?

View 2 Replies

Array Buttons And Movieclip Change?

Oct 23, 2011

How can I make that when I press one of the button arrays then a movie clip loads in the frame where it sends me? for example on the company. And then the movie clip unloads and another loads when I click on tutorials? forexample.i just want that clicking a specific array button triggers the appearance of my movieclip in only the frame where the button sends me.ere's the code for the menu:

Caurina.Transitions.Tweener import;
var menu_label: Array = new Array ("Home", "The Company", "Online Store"
"Service Center", "tutorials", "Contact");

[code].......

View 1 Replies

ActionScript 3.0 :: MovieClip - Add The Array To The Pop Up Buttons?

Aug 1, 2011

I am kinda new to flash, but I have been able to navigate myself around enough to learn a thing or 2. I have an array of movie clip buttons that when clicked stays in the down position until a new button is clicked. When one of those buttons is clicked a movieClip goes accross the stage (above the other array) and 6 new options open up for a photographers gallery (Newborns, children, family, etc, etc, etc) I am trying to add an array to the new buttons that show when a portfolio button is clicked, but keep getting an error in the output panel saying something about trying to access a "null" object. I have put the new array script in the movie clip button "portfolio" and I have also tried in the main timeline.

I assume that my problem is that the movie clips for the buttons I am trying to add the array to dont really show up at all until the down status of the button. Or I could definietly be wrong. How would I add the array to the pop up buttons?

View 10 Replies

ActionScript 3.0 :: Array Of Buttons Invisibility?

Sep 28, 2011

I have the follwoing array:
 
var botones:Array  = new Array("first_btn", "previos_btn", "last_btn", "exit_btn", "script_btn", "interaction_btn", "document_btn");
 
if I use botones.visible = false; they do no disappear. How can I hide them?

View 1 Replies

ActionScript 3.0 :: Add Preloader To Buttons Using Array?

Jan 7, 2010

I have four buttons and I want to stick a preloader to every button clicked to load an external swf. My swfs and buttons are in array and so is my preloader, but I cant bring my preloader mc to my progress load event! I need to pass the movieclip from a button click event to the load event=)

My code:

ActionScript Code:
var path = content.nav;
var butts:Array = [path.butt1,path.butt2,path.butt3,path.butt4];
var loaders:Array = [path.buttLoader1, path.buttLoader2]

[Code].....

View 3 Replies

ActionScript 2.0 :: Buttons Properties Specified By An Array?

Feb 7, 2010

I currently have many buttons and respective hotspots that run using repetitive actionscript code. I would like to replace this with more efficient arrays.For example, I have a hotspot called btnCommercials and it's respective movieclip called commercials.

ActionScript Code:
var btnArray:Object = [
{btn: btnCommercials, mc: commercials},
{btn: btnMusicVideos, mc: music_videos},

[code]....

View 4 Replies

ActionScript 3.0 :: AddEventListener & Array Of Buttons?

Aug 29, 2011

I have an array of buttons - for example "Save & Exit", "Cancel" and "Exit". When one of the buttons is hit I call "button.addEventListener(MouseEvent.CLICK, displayMessage);". In displayMessage, I have a switch statement to determine what button is depressed. However, I don't know how to identify what button is pressed. See question marks below:

private static function handleMenu():void {
// Determine which menu button was pressed
switch (????) {

[code]......

View 1 Replies

Actionscript 2.0 :: Targeting Buttons In An Array?

Feb 5, 2009

i have a series of buttons in an array, and i want to change the alpha of all of the buttons when a button (outside of this array) is clicked. i can change the alpha of all of the buttons inside the for loop, but not when the button is clicked. (the button is functional and being referenced correctly, as the trace does work.)what do i need to do differently to be able to control these buttons?

Code: Select all
var theBtns:Array = [btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8];
for(i=0;i<theBtns.length;i++){

[code]....

View 3 Replies

ActionScript 2.0 :: Duplicating The Array Of Buttons?

Apr 13, 2007

Working on my website navigation system with for loop and arrays. Here is the look right now top right nav working.Im trying to have the word links fade in white on mouseOver and fade to blue onpress. and fade back to normal when another button is pressed. any suggestions on how i should go about doing this?I was thinking of duplicating the arreay of buttons but have the mouse over fade in the white font array buttons on mouse over. But not sure if that would be a good idea or if it would work.

View 2 Replies

ActionScript 2.0 :: OnRollover Several Buttons Using Array?

Mar 3, 2008

I have a hundred buttons on the screen. I also have an array containing a list of all 100 buttons.Now, I want to use the same onRollOver method for every button. I DON'T want to program each button separately.

I am thinking something along these lines:

[code]...

Can I do this using an array?

View 3 Replies

ActionScript 2.0 :: Using An Array With Buttons On The Stage?

Jun 15, 2009

I'm familiar with using arrays with for loops, where the buttons are created dynamically. However I'm building an application with calendar month grids, where maybe half the dates are clickable. How would I use an array to address these buttons so I don't have to write code for each individual button? Or is there a better way than using an array to keep my code as simple as possible?

View 7 Replies

ActionScript 2.0 :: Create An Array Of Buttons?

Sep 17, 2003

I want to create an array of buttons, the buttons are called popupone, popuptwo, popupthree etc.

When the scene is loaded these buttons visibility is set to false so they are invisible. I want to be able to randomly pick one of these buttons from the array and display it to the screen _visible = true.

View 3 Replies

ActionScript 2.0 :: Fade Buttons With Array?

Nov 25, 2003

I have 6 "status" buttons as movieclips... and I have a separate menu with the same options as the 6 status buttons. When I click a menu option from that separate menu, I'm trying to dim out the 5 buttons that are inactive leaving the item chosen active.

Here is the code that I have so far but when I click one of the menu items, all of the buttons dim instead of all but the item clicked.[code]...

View 4 Replies

ActionScript 2.0 :: CS4 - Addressing Buttons In A Dynamic Array

Mar 10, 2009

I've got a column of buttons that load dynamically with attachMovie, and are named in the for loop as "patentBtn"+i+"_mc" etc.

When I address them in the code like this:

Code:
patMenuHolder_mc.patentBtn0_mc.onRelease = function(){
gotoAndStop("Claims1");
patMenuHolder_mc.patentBtn0_mc.gotoAndStop("active");

[Code]......

View 11 Replies







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