ActionScript 2.0 :: Getting The Pressed Movieclip In An Array?

Nov 18, 2003

I've got an problem with reading out an array, the array is filled with movieclips with each an different picture in it (php variable -an url). Basically what i want to do is get the pressed movieclip and use another method to change the _xscale and _yscale properties of the pressed movieclip (an picture) and then pass it back to the function brillenArray.onEnterFrame to change the values of that movieclip!

Only thing what i now get is that either all of the pictures move or none...

[AS]
brillenArray = new Array();
for (var i = 0; i<5; i++) {
if (this['plaatje'+i] != undefined) {

[Code].....

If i press one of the four pictures it does what i want to: THAT picture scales to 70. But how can i call this movieclip (the pressed one) from another method without using specified place in the array (like brillenArray[1])?

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Call An OnClipEvent(enterframe) Of A Movieclip To Happen When That Movieclip Is Pressed?

Oct 24, 2007

how do you call an onClipEvent(enterframe) of a movieclip to happen when that movieclip is pressed?

[Code]...

when i type this in i get an error because on events cannot be nested within other on events. how can you get around this?

View 10 Replies

ActionScript 2.0 :: Detect The Pressed Movieclip Outof 4 Movieclip?

Jun 13, 2011

i am new to flash AS,i have 4 movieclips, those have the 4 option of a question, when i select the answer,if it correct means my score will increase otherwise it will show alert,for that first i have to press the any one movieclip out of 4 options, in AS3.0 addEventHandler will work for AS2.0 what will i use to achive this

[Code]...

in this answer1, answer2,answer3,answer4 are the movieclip for 4 options

View 1 Replies

ActionScript 2.0 :: Display The Array On Screen If A Button Is Pressed?

Mar 31, 2009

If I have an array of strings, how can I display the array on screen if a button is pressed?

View 2 Replies

ActionScript 1/2 :: Make A Movieclip Play Only While A Key Is Pressed?

Mar 21, 2012

this is the code i am using, i get what flash is doing, after i release the key it starts to play the "walking" frames- only i include the gotoAndStop("idle") so it doesn't get to play "walking".but what i am looking for it to do is play the  walking only when the key is pressed and stop when released.

onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT))//68
{
this._x += moveSpeed;
this.legs.gotoAndPlay("walking");

[code]....

View 1 Replies

ActionScript 3.0 :: AddListener Firing When Pressed On Another Movieclip

Jan 3, 2011

I had an odd occurance where a listener was firing when I pressed on another movieclip. Both functions executed, which obviously caused some trouble. I fixed the misfiring listener by creating a new child (panel) and then adding the listener's movieclip to panel.

View 3 Replies

ActionScript 2.0 :: Fading Out MovieClip When Button Pressed

Jul 2, 2004

on (release){
_root.drew._visible =false;
gotoAndPlay(31);
}
Above is my code which I am using to try and fade out a MC when a button is pressed. The button (and the picture it shows when pressed) are within the same MC. I have placed this MC on the root timeline and given the MC I want to fade out the instance name drew // but still not having any luck making invisible.

View 4 Replies

ActionScript 2.0 :: Make A Box That Fades In When Pressed On The Button And Fade Out When Pressed For The Second Time?

Nov 16, 2004

I have a function on root:

_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();[code]....

This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say

on (press){
_root.fade = true;
}

the mc fades in, but I cant do another on (press) to fade out. Is this too confusing?

View 2 Replies

ActionScript 2.0 :: MovieClip Resize Animation When Button Pressed

Mar 17, 2004

{URL] Here I have a movieclip that I want the clip size to change when pressed a button, and change into another size when another button is pressed. but all these, with actionscript movement. How do I...? Here is the fla: [URL]

View 3 Replies

ActionScript 2.0 :: Unload A Movieclip When It's Pressed And Load Another One In Its Place?

Jan 19, 2008

I'm trying to unload a movieclip when it's pressed and load another one in its place. For some reason the loaded movieclip is always being loaded at row 7 column 10.

Code:
var columns:Number = 10;
var rows:Number = 7;
for (i=0; i<rows; i++) {
for (j=0; j<columns; j++) {

[code]....

View 1 Replies

ActionScript 2.0 :: AttachMovie - Loading MovieClip When Button Pressed

Apr 11, 2008

Adobe Flash CS3
publishing as Flash 8, AS 2.0
I have a movieclip named menu (instance name = mainmenu). Inside of that there is a button named btn_about (instance name = about). On the main stage there is an empty movieclip named empty_mc (instance name = mcholder, linkage id = empty). I want a user to press the button which causes a movieclip in the library named tesst (Linkage name = testid) to load into the empty movieclip (mc_holder).

Here is the code on the button:
on (release) {
this._parent.mcholder.attachMovie("testid", "tesst1", this.getNextHighestDepth());
}
It does not work.

View 2 Replies

ActionScript 2.0 :: Changing MovieClip Scale When Button Pressed

Jun 12, 2002

Is there any possibility to combine those two handlers. I want a movieclip changing its scale when a button is pressed. The change I would write as this:
onClipEvent(enterFrame) {
if (_scale<200) {
_scale+=10;
}}

But I can't write
on (release) {
onClipEvent(enterFrame) {
...
Is there a way to realize it?

View 4 Replies

ActionScript 3.0 :: MovieClip Change Animation Depending On Key Pressed

Jul 26, 2009

I have started to make an interactive movie where pushing keys moves a movie clip around the stage! And I can obviously make the movie clip do what I want, so here is the question: I want to make the movie clip change its animation depending on which keys are being pushed i.e. Left key the movie clips moves left, and my stick man changes to a running animation. Push nothing and it changes back to his standing still animation.

View 2 Replies

ActionScript 3.0 :: External Class Reads Which MovieClip Is Pressed

Sep 30, 2011

I have an external class which will add an eventListener to a bunch of movieClips. I did this this way so I dont have to write 80+ eventListeners. BUT how can Flash tell which movieClip I'm pressing?And how can I specificly let something happen for that specific instance?

View 1 Replies

ActionScript 3.0 :: When A Button Is Pressed It Adds Another Movieclip (from The Library)?

Jan 14, 2012

When a button is pressed it adds another movieclip (from the library) to a movieclip acting as a container at the bottom of the screen. This all works fine, and the movieclip is added to the container (directly in the middle), what i need is it to be positioned to the left. Obviously i could change the .x value, but its a little bit more complicated, because if there is already one movieclip there (in the container at the bottom), the next one that is added needs to be 25 pixels to the right of the movieclip already there.

Code:
var bass1:Bass1 = new Bass1();
//navigation
help_bt.addEventListener(MouseEvent.MOUSE_UP,help);[code].....

View 14 Replies

ActionScript 2.0 :: Call The Function PressMc When Movieclip MyMC_mc Is Pressed ?

Nov 11, 2005

In the following code I am trying to call the function pressMc when movieclip myMC_mc is pressed and the apply the drag action to it. However the drag action is being applied to the whole of level0 and therefore all of the moviclips.I am not sure why. Am using the this key word as I would expect this to be identified as myMC_mc when the myMC_mc.onPress is evoked.I want to write this as a function because I want to apply this drag action to lots of different movieclips

function pressMc (){
delete this.oldX;
delete this.oldY;[code]....

View 5 Replies

Trace A Text If The Mouse Is Pressed (MouseDown) And Is It's On A Movieclip (DragOver,RollOver)?

Apr 5, 2009

I want to trace a text if the mouse is pressed (MouseDown) and is it's on a movieclip (DragOver,RollOver)...can't manage to put all the 3 condition allong for the script to work...

View 1 Replies

ActionScript 1/2 :: Keys Pressed Or Not Pressed?

Dec 6, 2010

I am struggling a bit with keys on the keyboards controlling a movieclip to happen.Ive got a person moving when pressing right and left, and a movieclip with three frames: First frame is a movieclip with the person standing still, looking bored. The second frame is the person moving right, and the third frame is the person moving left.This is the code that Ive inserted into the persons actions on scene1:

if (Key.isDown(Key.RIGHT)) {_x += speed;this.gotoAndStop(2);_xscale = +scale;} 
if (Key.isDown(Key.LEFT)) {_x -= speed;this.gotoAndStop(3);_xscale = -scale;}
 
this code works alright accept that when the keys are not pressed it doesnt stand still, the legs are still moving, so I tried to include this code aswell:

if (!Key.isDown(KEY.RIGHT)) [code]....this makes the person standing still when not pressed but not moving the legs when turning right and left.

View 3 Replies

Use Either Maintaining Movieclip Array Or Bitmap Data Array?

Jun 5, 2009

I am working on a project in which I am suppose to matain an array of movieclips, and I can also convert the movieclips into bitmap data. so I would like to know which one is the best to use either maintaing movieclip array or bitmap data array.

View 2 Replies

ActionScript 3.0 :: Controlling Movieclip From Array - Goto Inside Movieclip?

Oct 27, 2011

i have dynamic buttons in movieclip and i want the movieclip goto 2nd frame once some one click single movieclip while rest remains in 1st frame.the movieclips can be in arrayi have some code here:

Actionscript Code:
var mc:MovieClip = new MovieClip();for(var i:int = 0 ; i < numberOfButtons;i++){  var btn:MovieClip = new button(); 

[code]....

View 5 Replies

ActionScript 3.0 :: Array Doesnt Work - Gettng Message 1067 : Implicit Coercion Of A Value Of Type Array To An Unrelated Type Flash.display:MovieClip."?

May 27, 2011

Why doesnt my Array work? I get this message:
"Scene 1, Layer 'Actions', Frame 1, Line 83 1067: Implicit coercion of a value of type Array to an unrelated type flash.display:MovieClip."

PHP Code:

var boxArray:Array= new Array();boxArray.push(WallLeft);boxArray.push(WallLeft2);

PHP Code:[code]...

View 5 Replies

Put All Children Of A MovieClip Into An Array?

Jul 11, 2011

I have an movieClip Container and I want to move all its children into an Array.i think about the method I used to delete all children of a container by using while and removechild at 0, but I think it wont work in this situation.

View 2 Replies

ActionScript 3.0 :: Refer To Movieclip Within Array

Mar 16, 2010

I have an array that movieclips are added into depending on the users actions. When they are added to the the array, they are also added to the display list of another movieclip on the stage.I'm trying to refer to them later so I can remove them from this movieclip's display list, but I can't work out the wording.[code]

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 1/2 :: Rotate Movieclip In An Array

Feb 22, 2011

I have created an array on my main timeline to fire melons constantly. I need the melon to rotate through the air I know that I can use a variable of rotate but I cant figure out where to put it.

[Code]...

View 5 Replies

ActionScript 3.0 :: Movieclip References In An Array

Feb 27, 2011

I have a movie clip in which I have a number of sub movieclips. The number of sub movieclips can vary, so I would like to keep track of them in an array. I am doing that like so:[code]The trace seems fine, showing the names of the correct sub movieclips, but when I try to change the alpha I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 3 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

Flash :: Reference An Movieclip With Same Name In An Array?

Mar 6, 2011

I realize this is very basic but i need a quick way of referencing all my objects in an array,I have a series of movieclips with instance names "block1" "block2"... etc.

I there a quick way to reference these in an array something like "block"+1 ?

View 1 Replies

ActionScript 3.0 :: Removing MovieClip From Array?

Apr 25, 2011

I've currently got an array made up of Movie Clips, and a variable to tell us how long that array is. It looks like this:

ActionScript Code:
var coinArray:Array = [coin1, coin2]; //an array which contains all of the coins
var numCoinArray:int = coinArray.length; //how many objects are in the coinArray

I've got a function called collisionTest which tests a collision between two objects.

So, I've got a loop set-up so if my character and a coin collides, it removes the coin it collided with from an array. It looks like this:

ActionScript Code:
function coinCollect(evt:Event)
{
for (var i:int = 0; i < numCoinArray; i++)
{

[Code].....

Is this trying to reference my objects as something other than MovieClips and is finding them and not recognizing them? I'm completely lost on this and can't understand why it doesn't work.

View 8 Replies

ActionScript 3.0 :: Referencing Movieclip In Array

Jun 13, 2011

Just learning as3. For testing purposes, I duplicated a movieclip 4 times on the stage and gave each mc a different instance name and put them in an array ("line1","line2","line3","line4"). Then I just want one movieclip to move 200 pixels based on the conditions of the array. Here is the code:

var stuff:Array = new Array("line1","line2","line3","line4");
for(var i:int=0;i<stuff.length;i++)
{
if ((stuff[i]) == "line4") {
trace(stuff[i]);
var duke = (stuff[i]);
[duke]y += 200;
}
}

It traces out the correct mc (line4) but ALL the movieclips move 200 pixels instead of the one (line4). Do you know why this is? I have a feeling that [duke]y is not the correct way to reference the movieclip.

View 2 Replies







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