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
Similar Posts:
Dec 21, 2011
I want to display photos and load them dynamically.What I have is pretty basic .[URL]I have this much done and normally I would just manually add the URL to each button (boring and tedious) and I am learning to import variables and images and all of that...I want to be able to click the thumb to see the actual image:
Main Stage:
code:
onClipEvent(load){
_xscale=1000;
_yscale=1000;
[code]...
my problem is that I want to pass a value to the button based on 'i'
code: _root.mc_picGroup.mc_picGroupA["btnPic"+i].strURL = i;
Then the image name would be 0.jpg,1.jpg,2.jpg etc...I was displaying the images based on an MC
_root.mc_picGroup.mc_picGroupA["mc_picHolder"+i].gotoAndStop(i);
That worked but I thought it would be easier to place it in the button.(That didn't work...) I will just use the image mc but my real roblem is passing the value to the button.
code:
on (release){
getURL(strURL+".jpg","_blank");
trace(this._name);
}
returns "mc_picGroupA" instead of the button I am clicking.I know its ugly, but I just thought it would be a cool way to display some photos.[URL]
View 2 Replies
Aug 4, 2011
ive made a simple button that sends you to the first frame. and its working good but than when i duplicate it only 1 button works i got 33 buttons and only one of them is working....
View 4 Replies
Jun 18, 2007
but in a more complex way. I have an existing 2d array that I want to copy to a new 2d array (but the NEW array can vary in size!).
For example, my current 2d array with the data:
var old_array =
[[0,1,2,3,4],
[5,6,7,8,9],
[10,11,12,13]];
And I want the new array to contain the same data as the old_array, yet if the new array is larger, it will put a zero instead of 'undefined'...like this:
var new_array =
[[0,1,2,3,4,0,0],
[5,6,7,8,9,0,0],
[10,11,12,13,0,0],
[0,0,0,0,0,0,0]];
View 3 Replies
Jun 28, 2003
hey, i'm trying to create a list by duplicating buttons, and then when these buttons are clicked, they load a movie
so far here's my script in a frame
[AS]
text1 = "link1";
text2 = "link2";
[Code]...
however this doesn't work too well, the position of new buttons dont really go where they are supposed to go (which should be directly under each other). neither does the entering of the text in the new button work.
View 5 Replies
Dec 21, 2008
I am writing an interactive 'bingo' game which creates a bingo card with 20 boxes. In AS2 I used duplicateMovieClip and 'push'ed the duplicate into an array. I could them access each movie clip when clicked (to turn a cross on or off on the movie clip). My original movie clip is called symbol_box_mc and the array I want to push it into is called symbol_box I've a load of other queries about this project but one step at a time! I've defined the array earlier with... var symbol_box:Array = new Array();
View 3 Replies
Mar 8, 2012
If i was loading external content, such as images or what not will the array load the items twice for example:
load = array(){
load images( "local/folder/www.example.com/" );
items("car.jpeg","bike.jpeg","bike.jpeg");
}
The above is in theory, if you notice twice i have the "bike.jpeg" image in the array; its key value would be either items[1] or items [2].
so with the above idea in mind would this bike image be loaded twice or just referenced in the array from the first initial load.
View 1 Replies
May 8, 2010
I successfully loaded 8 objects and pushed them into an array. The problem is that if I want to have the same object in 2 places, it deletes the old one to make a new. Ex:
I am looping through an 9x9 grid btw and goto a MySQL database to find what tile needs to be placed where.
ActionScript Code:
function onResult(responds:Object):void
{
var dbArray:Array = responds.serverInfo.initialData;
[Code].....
It will load fine but once I hit a tile that was already used, it moves it to the new square.
View 5 Replies
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Aug 21, 2009
I have 8 buttons in an array.I need to do a shuffle on the array where the buttons are randomly placed in the same array.
View 1 Replies
Oct 22, 2009
I need 6 buttons to control the same array. it's a list of 12 things.
Button1 loads the first image in the array
Button2 loads to the next image in the array
Button3 loads to the previous image in the array
Button4 loads the 1st image in the array (yes two buttons to do the same thing but it's necessary)
Button5 loads the 4th image in the array
Button6 loads the 7th image in the array
Button7 loads the 9th image in the array.
on top of that if no button is pressed the next image in the array moves forward after 15 seconds.how to do this with a set of images. Eventually the Array will become an xml document which accesses images, and two text fields.
View 2 Replies
May 10, 2009
I'm still stuck on this! I've tried so many things and still can't get it to work. I've watched Tim Perkins' Lynda.com stuff and I still can't get this to work!
This is where I'm at now with the code. It works to an extent, but doesn't lock out the other bArrays when the first one is clicked. I would like the code to stop bArray2 & bArray3 from functioning when a button in bArray1 is clicked. Is this at all possible?[code]...
View 7 Replies
Jun 3, 2009
a lot of the details and actionscript for my project were dealt with in another thread[URL].. what I would like to do is use buttons to jump between videos that are being fed to flvplayback, I have the actionscript skills of a rural victorian coal miner, fortunately I have the drive and bloody mindedness of a rural victorian coal miner so hopefully these things should balance out.
the action scrip I have scrawled for my button so far is as follows...
function introductionHandler(evt:MouseEvent):void{ // load given movie videoIndex = 0;}introduction_btn.addEventListener(MouseEvent.CLICK,introductionHandler );
View 2 Replies