ActionScript 2.0 :: 4 Buttons Move Down OnPress Using The For Loop?

Mar 14, 2007

I using a for loop for a redundant action that I want to happen across 5 buttons. OnRollOver the button rotates. OnPress the button moves to a new position. It looks like this:

Code:
for(i=0;i<5;i++){
_root.swatch_mc['swatch'+i].onRollOver = function () {
this.onEnterFrame = function () {[code]....

My problem is this; onPress I want the button to move up (Ive achieved this already). I also want the other buttons to move down onPress (this is my problem). Is there a way have the other 4 buttons move down onPress using the for loop? Or is there another method of doing this?

View 2 Replies


Similar Posts:


ActionScript 2.0 :: OnPress - Four Buttons Inside For Loop

Jun 22, 2010

I'm trying to write onPress for 4 buttons inside a for loop.
This lines traces undefined:
Code:
trace(_root.TeachMethodArr1[count]) // undefined.
This is because count is no more starting from 0 when I click the buttons.

Code:
var TeachMethodArr1:Array=new Array()
var TeachMethodArr2:Array=new Array()
TeachMethodArr1 = ["a","b","c","b","e"]
TeachMethodArr2 = ["a","b","c","b","e"]
for(var count:Number=0;
[Code] .....

View 1 Replies

ActionScript 2.0 :: OnPress In A For Loop And Spacing?

Apr 9, 2008

Ok so options is the array there can be many or one outside swf. we go through the array creating empty movieClip and populating each with an outside swf. Once loaded i want to use these newly created movieClips as buttons.

1. can i declare the onPress in a for loop?

2. how do i centre and space them no matter how many they are the will be linear.

Code:
for (var i:Number = 1 ; i<options.length; i++){
//create a holder
_root.createEmptyMovieClip("optionD"+i,4+i);

[Code]....

View 1 Replies

ActionScript 2.0 :: OnPress Loop For Multiple MovieClips

Apr 16, 2005

Everytime I press a movieClip, i -1(on the output window) should be equal to the number of the movieClip (ex: myClip17, when pressed, should produce in the output window a value of 17 for i-1). Please copy paste this code to a flash document and you'll see what I mean (please don't forget that you have to have linkage in the library for a movieClip symbol that you have to create - it's a circle only with stroke that has w=15 h=15). Every time I click on a number it should appear a circle on it. If the circle is already there it should disappear. But that's not the case. Somehow every movieClip has the order to attach one of the instances of movieclip marca_mc to myClip31.

var mcAcoplado = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
var diasDoMes = 31+1;
var distEntreTexto = 10;
for (i=1; i<diasDoMes; i++) {
[Code] .....

View 5 Replies

ActionScript 2.0 :: Assigning OnPress Functions In A Loop?

Sep 16, 2006

is that possible? i'm a complete beginner when it comes to flash and actionscript... so if it sounds like i dont know what i'm talking about... it's because i don't!let me describe my situation...I have about 20 boxes... and on each box i want to assign the onPress to trace the value corresponding to an Array at element "i" in the console...instead of doing:

Code:
box1.onPress = function() {
trace("the value is: "+hypotheticalArray[1]);

[code].....

View 1 Replies

ActionScript 2.0 :: OnPress Within A Loop (array Of Movieclips)?

Mar 6, 2012

I'm having troubble with the .onPress function. I've made an array of movieclips, and i want to go through them in a loop, and make an onPress function for each of them. What im trying to do with the code below is to make the debugText tell me what movieclip i pressed:

var letterArray = new Array();
letterArray = [l1_mc, l2_mc, l3_mc, l4_mc, l5_mc, l6_mc, l7_mc, l8_mc, l9_mc,
l10_mc, l11_mc, l12_mc, l13_mc, l14_mc, l15_mc, l16_mc, l17_mc, l18_mc,

[code].....

View 3 Replies

ActionScript 2.0 :: OnPress Loop For Multiple MovieClips?

Apr 16, 2005

The problem is: everytime I press a movieClip, i -1(on the output window) should be equal to the number of the movieClip (ex: myClip17, when pressed, should produce in the output window a value of 17 for i-1).Please copy paste this code to a flash document and you'll see what I mean (please don't forget that you have to have linkage in the library for a movieClip symbol that you have to create - it's a circle only with stroke that has w=15 h=15).Every time I click on a number it shouldappear a circle on him. If the circle is already there it should disappear. But that's not the case. Somehow every movieClip has the order to attach one of the instances of movieclip marca_mc to myClip31.

var mcAcoplado = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];

[code]....

View 5 Replies

ActionScript 2.0 :: OnPress Function For Multiple MovieClips In Loop

Mar 7, 2012

I'm trying to make a point and click game for the fun of it. I'm having troubble with the .onPress function. I've made an array of movieclips, and I want to go through them in a loop, and make an onPress function for each of them. What I am trying to do with the code below is to make the debugText tell me what movieclip I pressed:

var letterArray = new Array();
letterArray = [l1_mc, l2_mc, l3_mc, l4_mc, l5_mc, l6_mc, l7_mc, l8_mc, l9_mc,
l10_mc, l11_mc, l12_mc, l13_mc, l14_mc, l15_mc, l16_mc, l17_mc, l18_mc,
l19_mc, l20_mc, l21_mc, l22_mc, l23_mc, l24_mc, l25_mc, l26_mc, l27_mc,
l28_mc, l29_mc, l30_mc, l31_mc, l32_mc, l33_mc, l34_mc, l35_mc, l36_mc];
[Code] .....

DebugText outputs:
Pressed movieclip nr: 36 36 36 36 36 36
No matter what clip i press, i get the same output: 36. why?

View 5 Replies

ActionScript 2.0 :: Move And Loop - Move An Object Across The Stage And Once Out Of Site

Dec 11, 2006

I know this is very noob, but I need a simple AS move and loop. Move an object across the stage and once out of site, loop and start over again? It needs to be a slow and endless loop.

View 3 Replies

ActionScript 1/2 :: Buttons Don't Work After Adding OnPress?

Nov 12, 2009

I have an MC that has a graphic. I have faked buttons for just the over state, so it shows a border around a portion of the graphic. That works fine until I added this to the MC:
 
this.onPress = function(){    if (this._currentframe != 1) {
rewind = true;
}}
 
The onPress function does what it should do, but the buttons no longer show their over state when I hover over them.

View 7 Replies

ActionScript 2.0 :: Buttons In Array - OnPress Correct Sequence

Feb 10, 2011

I have pressed the buttons in a array. The objective is press the buttons in the correct sequence.
Correct sequence click "btn1 and btn2" or " btn2 or btn1"
Correct sequence click "btn3 and btn4" or " btn4 or btn3"
Inc correct sequence click "btn1 and btn4" or " btn4 or btn1"
and so on.

I've place a trace the button is returned undefined.
ActionScript Code:
var buttonArray = new Array(btn1, btn2, btn3, btn4);
var clicks = 0;
for(i =0; i < buttonArray.length; i++){
buttonArray[i] .onPress = function(){
trace(buttonArray[i] + "click");
}}

View 9 Replies

ActionScript 3.0 :: Make Buttons That On Rollover Move To Left - On Rollout Move Back To Their Initial Position

Dec 15, 2009

well i want to make buttons that on rollover move to left, on rollout move back to their initial position, and if clicked, they but stay this time at the final rollover place, and be there until something else is clicked. When something else is clicked, the previous button , returns to its initial place. So i ve got it all figured out except for the freeze and move part when the buttons are clicked. All it does now , is when they are clicked they freeze at the position i want, but i havent got a clue how to update them, after so they start moving back, and reacting on rollover and rollout, when the next button is clicked.

[Code]...

View 2 Replies

ActionScript 2.0 :: Get The Mc To Move But The Buttons Remain Inactive And Also The Rollover States On The Buttons Don't Work

Jul 8, 2005

I am having trouble with a job I am doing at the moment which has an mc with buttons within it. I want it so that when I roll over the mc it tweens from a small version to a larger version, and on this mc there are some buttons. At the moment I can get the mc to move but the buttons remain inactive and also the rollover states on the buttons don't work. I have attached a simpler version of what I am trying to do to this post.

View 3 Replies

ActionScript 2.0 :: The Text Buttons Should On Rollover Move All Buttons To The Left

Oct 22, 2010

I'm creating a menu system, the text buttons should, on rollover, move all buttons to the left (of the button currently rolled over) 100 pixels, in the gap created a sub menu running vertically will appear which will break into a 2nd horizontal submenu etc. I'm still in the early stages, and have hit a stumbling block, I placed a trace (this); cmd in root of the roll over function then again in each segement of the IF/ELSE loop inside that fuction. The trace CMD in the root of the rollover gives me the feed back _level0.btn1 or 2 or what ever button I have rolled over but the ones inside the IF/ELSE loop all say _level0.btn0 regardless of the button I roll over!

[Code]...

View 2 Replies

ActionScript 2.0 :: Array.onPress - Add A OnPress Event To Dynamically Duplicated MovieClips ID's Stored In Array List

Apr 15, 2011

lets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?

[Code]...

View 5 Replies

ActionScript 1/2 :: Move MCs With For Loop?

Jul 28, 2009

way to move movie clips with a for loop
 
I've got 10 dots called dt1-dt10 and I want to be able to set them all to y = 200.
I understand i can set i=1;i<11;i++
 
like
 
for(i=1;i<11;i++){
dt+i._y = 200;}
 
or
  
for(i=1;i<11;i++){
String("dt"+i)._y = 200;}
   
but the rest of it is a mess and either doesn't work, or glitches. I have yet to find a for loop help file for moving multiple movie clips.

View 2 Replies

ActionScript 2.0 :: Create Masks With Loop And Move Them

Nov 12, 2003

I'm trying to create the effect where it seems as if a picture is cut up in a number of pieces that slowly ease to their location where eventually they all form one image again. There must be an onEnterFrame handler somewhere in which the easing is done. I'm not sure exactly how to set it up though. Could somebody please have a look?

View 9 Replies

ActionScript 2.0 :: MC To Move From Right To Left And Loop Continuously?

Feb 12, 2002

Although this is so basic, I need some sum recollection refreshing on moving an MC across the stage. In fact, I really need sum codez to store in my actionscript archive in the event that my memory gets suddenly jaded, as it does sometimes. Thus, for example, I want my MC to move from right to left and loop continiously? something like Kirupa's footer on the bottom of this page? How would I set up the variables and the actions for that?

View 3 Replies

ActionScript 2.0 :: Create Masks With Loop And Move Them?

Nov 12, 2003

also think it has been asked before. I searched but couldn't find it so here goes:I'm trying to create the effect where it seems as if a picture is cut up in a number of pieces that slowly ease to their location where eventually they all form one image again. (can't find a proper term for it, sorry)Maybe the attached fla will make things more clear.There must be an onEnterFrame handler somewhere in which the easing is done. I'm not sure exactly how to set it up though.

View 9 Replies

ActionScript 2.0 :: Clickable Button Within Loop To Move Between Scenes

Dec 10, 2011

I'm working on Flash CS3, ActionScript 2.0 on a project assignment for my class. I'm working in 6 different scenes within the one file. I have Scene 1 on a loop, but need a button that is clickable within the loop to move the program onto Scene 2. I have converted the image I want to a button, but I do not know what to do next in order to make it link from Scene 1 to Scene 2.

View 5 Replies

ActionScript 3.0 :: Make An Object Move Right In A Loop Where It Will Not Stop?

Jul 27, 2009

How would I make an object move right in a loop where it will not stop?

View 6 Replies

ActionScript 2.0 :: Button OnPress Calls Another Button's OnPress?

Nov 5, 2007

[URL]

First, click on the Abaco island shape on the map. You'll see on rollOver there is a glow around the island. Now click on that island and the glow remains for the zoomed-in detailed view. When you return to map and zoom back out, the glow is removed.

Now, compare this with clicking on the island name "Abaco" from the list on the right, instead of clicking directly on the island from the map. It zooms in and shows the details fine, but the glow that should be there is not.

The reason this problem is very perplexing for me, is that the onPress action of the list button in the right column calls the onPress function of the map button. So, theoretically they should do the EXACT same thing when pushed. But clearly they don't.

Here is the code for the button from the list on the right panel:

Code:
listAbaco_mc.onRollOver = function() {
_root.map_mc.abaco_mc.button_btn.onRollOver();
};

[Code]....

There is more code, for example rollOver, rollOut, and Press actions for the other island buttons, but they are all of the exact same format as the Abaco island button and they all have the same problem.

So, to recap, the problem is that the list button in the right panel do not function properly onPress, even though they are calling the onPress function of the island buttons directly, and the island button onPress function works perfectly. Strangely, all but one little thing works. So it's obviously getting to the correct functions and going through the code as planned, yet that one part about the glow is being ignored or otherwise messed up.

View 12 Replies

ActionScript 2.0 :: Make A Simple For Loop That Makes A Line Move

May 27, 2003

I'm trying to make a simple for loop that makes a line move. But it won't work, and when i search for "for loop" it gives me all these dynamic things that are WAY over my head.[code]The way i see it, the i should increase by 1 each time the loop is run, and then the line will move up by 1 until it is at x = 0 (it starts at x = -77). But when i preview it in flash and html, nothing happens at all.

View 6 Replies

Actionscript 3.0 :: Move Buttons With MC

Aug 2, 2011

relatively new to flash and I'm trying to put together a little interactive map. On this map I have a series of buttons which when clicked display further information on the area it. The map is a movie clip and which can be moved about by dragging and dropping. When I move the map the buttons stay in the position I set them whilst the map move. How could I go about making the buttons follow their set position on the map when its moved.

View 4 Replies

On Mouseover Buttons That Move Objects

Jul 27, 2009

I am making a menu that consists of 6 different rollover buttons, these3 buttons sit on a path where the graphics look like a road. What I need to do is have an mc of a car that moves along the road. When the car is at button 1, and you mouseover button 2, the car moves towards button 2, then when you mouseover button 3, the car moves towards button 3 etc., all while the car stays on the road (path) that it sits on - so not like a mouse follow but constrained to the path. I also need the car to go in reverse, so if the car is at button 4, and you mouseover button 3, the car will move towards it.

View 3 Replies

IDE :: On Mouseover Buttons That Move Objects?

Jul 27, 2009

I am making a menu that consists of 6 different rollover buttons, these3 buttons sit on a path where the graphics look like a road.What I need to do is have an mc of a car that moves along the road.

When the car is at button 1, and you mouseover button 2, the car moves towards button 2, then when you mouseover button 3, the car moves towards button 3 etc... all while the car stays on the road (path) that it sits on - so not like a mouse follow but constrained to the path...I also need the car to go in reverse, so if the car is at button 4, and you mouseover button 3, the car will move towards it.

View 1 Replies

IDE :: Move A MC With LEFT And RIGHT Buttons And Stop When It Should

Sep 18, 2009

I know everyone has wrote this a hundred times, BUT I just can't get it to work

I have a main content area called MC that is very wide Then a mask around the area I want to see of the MC

I have two buttons set up below the mask for LEFT and RIGHT

How to I make those buttons move the main content, and stop when It gets to the end of the masked area so you dont just keep scrolling

ALL I HAVE in my code right now, is attached the left and right buttons---

on(release){
MC._y = (MC._y)-50;
}

is there more to it than that? How do I stop it?

View 2 Replies

Group And Move Bunch Of Buttons And MovieClips

Apr 9, 2009

I need to be able to click and drag multiple objects at the same time I can make it drag 2 objects but when I add another one it doesn't work?

View 2 Replies

Buttons: Clicking Mouse Outside To Move Between Frames

Jul 6, 2009

I am working on a menu that uses a number of these buttons: [URL]

The button works quite well, except that I would like the sub-menu to close up once the mouse clicks elsewhere on the screen. I have tried to find the Action Script for this but have been unsuccessful. What script can I use to cause the menu to close up when a user clicks outside of the button?

I've posted the fla file below.

[URL]

View 1 Replies

ActionScript 3.0 :: Buttons To Move Content Left And Right?

Feb 17, 2011

I want to do a web site that is very wide. so i want to put a horizontal menu on the bottom. Lets say i have 5 buttons on my menu and with these buttons i want to move the content left or right. so i could control were i want to be on my website using the buttons that just move the background or content left or right

View 2 Replies







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