Actionscript 3.0 :: CurrentTarget And Concatenation - Control A Movieclip With The Name Of "SuboneNav"

Jun 20, 2010

I was wondering how I can use something like: var mc:MovieClip = MovieClip(e.currentTarget); as part of another instance name. For example if the currentTarget was a move clip with an instance name of "oneNav" and then I wanted to control a movieclip with the name of "SuboneNav", how could I do it? All the variations of concatenation I'm familiar with weren't working (different variations of ["Sub"+mc]). I tried getting e.currentTarget.name instead but there are issues with using what it returns to reference a movieclip etc...

View 2 Replies


Similar Posts:


Actionscript 3.0 :: Control Scaling In Array Using Event.currentTarget

Jul 30, 2011

I'm trying to tween six Movieclip (using TweenLite) in an Array to where they scale up when pressed. When another is pressed it scales up and the others will scale down. I'm having trouble getting them to do this consistently. This is probably a minor fix for most of you, but I have been tackling this for two days.[code]

View 1 Replies

ActionScript 3.0 :: Control Scaling In Array Using Event.currentTarget?

Jul 30, 2011

I'm trying to tween six Movieclip (using TweenLite) in an Array to where they scale up when pressed. When another is pressed it scales up and the others will scale down.I'm having trouble getting them to do this consistently. This is probably a minor fix for most of you, but I have been tackling this for two days.

Code:
import flash.events.MouseEvent;
import flash.display.MovieClip;

[code].....

View 1 Replies

ActionScript 3.0 :: Attaching CurrentTarget To MovieClip?

Feb 11, 2011

I know I'm missing something rather basic here, but can't figure it out. I want to take a "currentlySelected" target of a hit test and attach it to a movieClip container. It traces as an object, but I can't figure out how to translate this to a movieClip. I'm sure I've done this before--- but I'm drawing a blank.

Code:
trace(currentlySelected + " hit test box 1")
currentlySelected.x=box1.x;

[code].....

View 1 Replies

ActionScript 3.0 :: CurrentTarget Child Movieclip Instance Name?

Jul 15, 2009

The code I am having trouble with is al the way at the bottom (Actions layer on the stage). Below the multi-line comment.Basically, I have a rotating image bar. One the first level of my file, on the stage, is a container movie clip called "imageScroll". The code that allows the images to rotate is applied to the container clip. Inside of "imageScroll", are a series of 36 images, each with their own unique instance name.On the main level, I have a block of code which first detects when the user mouses over imageScroll. Next my code attempts to dig down one level into imageScroll and find the instance name of the image the users mouse is hovering over.

I want to then store that instance name in a string "_destination", then take that string and store it in a MovieClip variable "currentClip". By doing this, I can then use the variable currentClip to effect the code at the bottom, which causes the images to scale up when the user mouses over, and scale back when the user mouses out.The way I currently have my file set up, the code always returns the instance name imageScroll. I am using event.currentTarget.name to try and pull the instance name of the image. I have tried using event.target.name, but that pulls the instance name of a movie clip two levels lower then I want to go.I basically need a way to modify my code so it finds out which movie clip inside of the container imageScroll the user is mousing over.For those who would prefer to have all the code here, see below:

Code:
//Import required flash packages
import flash.utils.*;

[code].....

View 1 Replies

ActionScript 3.0 :: Event.currentTarget - Use One Function For All Buttons - Load Another MovieClip In Library

Dec 7, 2009

I have a movieClip in my library that I am loading into a scrollPane. When I click on the scrollPane I want to know the name of the target I am clicking on. I am trying event.currentTarget but all that I get in the output box is ObjectMovieClip. I want to use one function for all my buttons so when I click on them it loads another movieClip in my library. I realize I could make 3 separate functions, but I'ld like to use just one.

[Code]....

View 13 Replies

Actionscript 3 :: Check If A Movieclip Exists On A Specific Location Relative To Event.currentTarget?

Sep 22, 2011

How can I check if the stage contains a movieclip on a specific x and y location on the stage?I'm building a colour-guessing game. The purpose is to walk a path through a generated field of hexagons, each assigned a random colour (yellow, red, blue or green), based on what soundfile you hear. So if you hear "yellow", you have to click a yellow tile etc.But because I want it to be a path, and the colours of the tiles are randomly generated, I have to check which colours border the currently active tile. I literally have no idea how to do this. I thought this might work but it doesnt:

if ((this.tile.y == (event.currentTarget.y - 64)) != null) {
//add the colour of this tile to array
}

[code].....

View 2 Replies

ActionScript 3.0 :: Why Concatenation Instead Of Add

Oct 20, 2009

trace(_thumbArea.getBoxHeight()); // 108
trace(_xml.verticalThumbSpacing); // 4
var shiftValue:int = _thumbArea.getBoxHeight() + _xml.verticalThumbSpacing;
trace(shiftValue); //1084

View 2 Replies

ActionScript 3.0 :: String Concatenation Onto Variable Name?

Aug 21, 2009

I've got this nasty 'switch' satement bugging me, not an ideal solution by any means.

I would like to refine it into a function, but I am stumped with an issue. My code is as follows:

[Code]...

View 4 Replies

ActionScript 2.0 :: Scooping Using Slice Concatenation?

Mar 19, 2011

When I trace the variable it comes out fine. But when I try to toggle the visibility with it, it doesn't work. I can toggle visibility when I manually type the path name. What am I missing?

[Code]...

View 3 Replies

Flex - Dynamically Setting Xml By String Concatenation?

Jul 2, 2010

I'm trying to read xml fields (with actionscript 3), but the problem is that I choose which field to read dynamically. For example, I may need to read test19 or test39 or test12 or anything else.

var value:Number = event.result.test19;
var value:Number = event.result.test39;
var value:Number = event.result.test12;

Is there a way to construct that event.result.test19 part dynamically? Something like the code idea below

[Code]...

View 1 Replies

Actionscript 3 :: Dynamic Instance Variable Name / Concatenation?

Feb 18, 2011

I have an array of project type codes like this:

project_types_array[0] = "p"

project_types_array[1] = "exp"

and a corresponding set of movie clips, exported for actionscript, with names:

type_p
type_exp

I want to somehow dynamically attach a movieclip on the stage according to the project type that exists in the array. I could just do something like this:

[code]...

View 1 Replies

ActionScript 3.0 :: Reference A Variable By String Concatenation?

Feb 7, 2011

I want to reuse these two functions for about 10 items that need to be dragged and dropped. I need to reference 10 Boolean variables on the main timeline by building strings in the functions to make up the Boolean names so I can reuse the functions. Check the coded in red. [URL] Fla is above

[AS]
stop()
var startX:Number;
var startY:Number;

[Code]....

View 1 Replies

ActionScript 2.0 :: Button Inside Movieclip To Control Another Movieclip's Timeline?

Oct 23, 2009

I have a button inside a movieclip, to which I would like to apply a rollover function. When rolled over, this button (inside MOVIECLIP 1) would make (MOVIECLIP 2) jump to second frame. I'm using Flash 8.This is turning onto a real headache for me, since i've searched every single forum and thread concerning this matter, and nothing seems to work.

View 7 Replies

ActionScript 2.0 :: [CS3] - Control Hero Movieclip With Movieclip Buttons

Jan 21, 2009

Originally, the client wanted to control "hero_mc" using the keyboard but now they would like to control him with buttons only. Here is the original code on the "hero_mc" which works as expected:

[Code]...

View 2 Replies

As3 :: Flash - Control A Movieclip From Within Another Movieclip?

Feb 1, 2012

I have got two movieclips on the main timeline. First one is envelope_mc and second is bg_main. In envelope_mc timeline there is a button on 25th frame which plays ahead when clicked.

stop();
on_btn.addEventListener(MouseEvent.CLICK, playAhead);
function playAhead(event:MouseEvent):void
{
play();
}

I have also got some animation on bg_main which I wan't to trigger on 30th frame (inside bg_main timeline) when button is clicked in envelope_mc timeline.

View 1 Replies

ActionScript 3.0 :: Using Event.currentTarget With XML?

Jan 16, 2009

I am loading a series of thumnails through an XML file into a scrolling movieClip. I am able to get all of the images to load and scroll and even control their alpha value using event.currentTarget. What I am having a problem with is getting the corresponding XML attribute(@title) to load into a dynamic text field.Here is a snippet of my XML file:

<thumbs>
<thumb img="http:url_1"
title="Title One" />[code]....

The thumbnail alpha changes and the text field changes to the text that is defined by the first title attribute. What I need to figure out is how to use a variable instead of the "#". I'm assuming that I should be able to make use of event.currentTarget like I did to change the alpha of the thumbail movieClip.

View 7 Replies

ActionScript 3.0 :: Target Or CurrentTarget?

Feb 18, 2011

I have 3 movieclips. Each sends the game to one level. Inside each movieclip theres more movieclips.

[Code]...

View 2 Replies

ActionScript 3.0 :: Run A Function With CurrentTarget.name?

Oct 25, 2011

i'm wondering how i can run a function that has the same name as the current target. so when i click a button with the instance name "notes" this will run the "notes" function e.g

ActionScript Code:
evt.currentTarget.name();//run the function with the same name as the target

this doesn't work and returns a Error #1006: value is not a function.

View 2 Replies

ActionScript 3.0 :: CurrentTarget With Nests ?

Nov 10, 2011

If you have a series of sprites in a movie clip, can you get the currentTarget.currentTarget as it were? So if a sprite throws a mouse event, I can capture that?

Sorry if that's gobbledegook.

I have a movie clip called myMC. In that are a series of sprites sitting in a vertical row. On mouse up I want to know which sprite I was over. currentTarget gives me the parent movie clip, can I get the sprite underneath?

View 7 Replies

IDE :: Event.currentTarget.name To External URL?

Mar 14, 2009

AS3 coding, and despite being able to find posts about most of my problems, this problem has stumped me, and I'm not certain what words to search for.I'm trying to make a list of MCs on my stage to link to external URLs.I figured the following would work, but it just pulls the 'event.currentTarget.name+"URL"'the instance names of the MCs are "idlink" and "findStore"Is there a way I can get the loadLink variable to pull the URL instead of the "idlinkURL" string, or is my logic for this completely backwards?

Code:
var buyLinks:Array = [idlink, findStore];
// add listeners to the menu array

[code].....

View 1 Replies

IDE :: Difference Between Target And CurrentTarget

Mar 19, 2009

whats the difference between target and currentTarget properties.

View 9 Replies

ActionScript 3.0 :: Opposite Of CurrentTarget?

Apr 13, 2010

Have 8 mc's, and when I click one want something to happen to all except the one that I clicked.My question is how do I declare "all except currentTarget" for a MouseEvent?

View 2 Replies

ActionScript 3.0 :: Select All Buttons Except CurrentTarget?

Jul 4, 2010

I have a set of 6 buttons and upon clicking one of the buttons i want to tween the others that were not clicked to fade out.

View 3 Replies

Flex :: Intersects Sprite And Get CurrentTarget?

Jan 10, 2011

I have create a few sprites consist of various music notes, when the cursor sprite move over to one of the notes, it would blink using intersect. I have no idea on how to make the cursor detect which note it overlap.

View 1 Replies

Flash :: Difference Between E.target And E.currentTarget?

May 7, 2011

I dont understand the difference, they both seems the same but... I guess they are not.

View 3 Replies

Flash :: AS3: Difference Between Target Vs CurrentTarget

Dec 15, 2011

Possible Duplicate: Difference between e.target and e.currentTarget I don't really understand the difference between these two event.target and event.CurrentTarget and explanation.

View 2 Replies

ActionScript 3.0 :: Using CurrentTarget As Part Of Another Instance Name

Jun 20, 2010

I'm new to AS3 and was wondering how I can use something like:
var mc:MovieClip = MovieClip(e.currentTarget);
As part of another instance name.
For example if the currentTarget was a move clip with an instance name of "oneNav" and then I wanted to control a movieclip with the name of "SuboneNav", how could I do it? All the variations of concatenation I'm familiar with weren't working. I even tied getting e.currentTarget.name instead but there always seems to be an issue.

View 5 Replies

Actionscript 3.0 :: What's The Difference Between E.target And E.currentTarget

Feb 11, 2009

Here is what the help defines both:

targetproperty

The event target. This property contains the target node. For example, if a user clicks an OK button, the target node is the display list node containing that button.

currentTargetproperty

The object that is actively processing the Event object with an event listener. For example, if a user clicks an OK button, the current target could be the node containing that button or one of its ancestors that has registered an event listener for that event.

View 2 Replies

ActionScript 3.0 :: Something Similar To CurrentTarget With DropTarget?

Mar 10, 2009

is there something similar to currentTarget with dropTarget?Right now dropTarget will get me the "lowest" DisplayObject possible, but I'd like to get the top-most. I cannot use parent as my objects are of different nesting depths.

View 1 Replies







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