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


Similar Posts:


Professional :: Event Listener - Remove The Child (e.currentTarget) And Create A New Child In Its Place With The Next Line But It Doesn't Work

Feb 19, 2010

public function GlobalSolutions()
{
Navigation(' Home ', 'index', 235, 0x97F9EC);
Navigation(' Office Supplies ', 'Office_Supplies', 295, 0x97F9EC);

[code]....
 
I want to remove the appropriate child (e.currentTarget) and create a new child in its place with the next line, but it doesn't work. What do?

View 13 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 :: Can't Swap Child For New Class Instance IF Child Is Exported For Action Script?

Aug 18, 2010

I have a movieClip with one frame on the timeline containing one child whose instance name is "myContent"I am using this function to swap "myContent" with any number of possible class instances.

Code:
function setContentAsClass(c:Class)
{

[code].....

View 2 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 :: 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 2.0 :: Add Child Movieclip Such That Extra Part Of Child Movieclip Is Hidden?

Sep 8, 2009

i have a parent movieclip mcA and i want to add another movieclip mcB (child movieclip) inside mcA such that the extra part of mcB is hidden. The size of movieclip remains same as of mcA

For ex:-

mcA = 300x300
mcB = 400x400

then only 300x300 of mcB movieclip is visible and rest of the part is hidden.

View 5 Replies

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

ActionScript 3.0 :: Remove Child And Add New Instance Of It?

Aug 11, 2009

I have 10 thumbnails loaded using a for loop through XML. Each thumbnail is clickable and have an event listener attached. [code]...

My problem is that the images are stacking on top of each other, and never being removed.

Ideally I what to removeChild(); to the previous child added when the showPicture function runs. But I have no idea how to achieve this.

View 2 Replies

ActionScript 3.0 :: Referring To A Child Instance Name?

Oct 6, 2009

still cant get my head around this..iv created balls inside a function is there a way to reference them out side of the function? with addChild() do they get instance names?

ActionScript Code:
makeBalls();
function makeBalls() {
for (var i:int=0; i<10; i++) {[code]...........

View 1 Replies

ActionScript 3.0 :: Child Pathway And Instance Name?

Apr 11, 2011

if i add a movieclip into another as a child why doesn't it have the same instance name anymore, how do i reference it?

ActionScript Code:
tile3.addEventListener(MouseEvent.MOUSE_DOWN, onBegin);
function onBegin (e:Event = null):void
{
tile1.addChild(tile2)
}

i thought to get at tile 2 now i would use tile1.tile2 but that doesn't work.

View 2 Replies

ActionScript 3.0 :: Add Child + Assign Instance Name?

Jan 3, 2012

how I can assign an instance name to my child.

View 6 Replies

ActionScript 3.0 :: Remove All Child Of A Movieclip If No Of Child Are Not Known?

Aug 19, 2009

how to remove all child of a movieclip if no of child are not known

View 2 Replies

ActionScript 3.0 :: Clearing A Child Instance From Stage?

Sep 10, 2010

OK this has been a process but i have gotten to the point where i am calling a feedback image for the different categories, I just need to clear the foodfeedback and artfeedback children when music is pressed and the same for the others

/*import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;

[code]......

View 3 Replies

ActionScript 3.0 :: Child Class Object Instance - What Can It Tell About It's Parent

Sep 15, 2010

If an object, or say... a document class, creates an instance of a class (and stores it as a variable), and it doesn't pass any arguments to the constructor of the class, can that class object, by simply having a function of it called by the parent, tell who sent it that command/request?In other words, can a class object know who called it (such as it's parent) via a (seemingly) anonymous call?

View 1 Replies

Actionscript 3 :: Access Child's Properties Of Created Instance

Jun 1, 2011

on my timeline i create a new instance of the class FirstClass with the following

code:
var firstObject:FirstClass = new FirstClass();

the class looks like this:

package {
public class FirstClass extends MovieClip {
public function FirstClass() {

[Code]....

On my timeline i would like to acces the x position of the object tempObject

View 1 Replies

ActionScript 3.0 :: Referencing A Child Of A New Object Instance From The Library?

May 20, 2009

I make a movie clip in the library ( a button with a text field on it ) and export it for actionscript. Then I create an instance of the object using code ( myButton = new Button1(); ).And then I want to access and change the text field ( whose instance name is "myField" in Flash ) afterwards.Is that possible, or I have to create a custom class for the object, or just create an entire button dynamically?

Because what I have tried until now doesn't work.

Code:
var button1:button_test1 = new button_test1();
button1.x = stage.width / 2;
button1.y = stage.width / 2;

[code]....

This questions is for all movie clips: is there a way to access a movie clip's objects with actionscript after you have created (with code) an instance of that object (which was designed in flash, and exported for AS) ?

View 2 Replies

ActionScript 3.0 :: Call The Instance Name Of A Button From Child.swf To Parent.swf?

Apr 8, 2010

one of my problem is that how do i call the instance name of a button from my child.swf to my parent.swf

i have four buttons from my child.swf where when i click btn1 it will load superchild.swf but i want to load that superchild.swf to my parent.swf, like instead btn1 calls superchild.swf to load, btn1 will call parent.swf then on parent.swf it will distinguish that btn1 was click from child.swf and it will now load superchild.swf.

View 3 Replies

ActionScript 3.0 :: How To Access Instance Property Through Child In Main Class

Jan 23, 2011

I have make 3 classes objecthandler, box and nav. Nav is child class of objecthandler, I have make an instance of box into objecthandler and now I wanna access property of box through nav.
See the code:
Objecthandler class
package code{
import flash.display.MovieClip
import code.box
import code.nav
[Code] .....

View 1 Replies

ActionScript 3.0 :: Child Class Object Instance - Anonymous Call

Sep 15, 2010

If an object, or say... a document class, creates an instance of a class (and stores it as a variable), and it doesn't pass any arguments to the constructor of the class, can that class object, by simply having a function of it called by the parent, tell who sent it that command/request? In other words, can a class object know who called it (such as it's parent) via a (seemingly) anonymous call?

View 1 Replies

Flash :: Address A Named Instance Of A Movieclip From The Class File Of The Movieclip?

Jun 1, 2011

I have a movieclip instance named 'placeholder' on the canvas, and I want to change the alpha of the named movieclip from it's class without effecting the alpha of all the movieclips of the same type. How would I specifically target the named movieclip instance that is on the canvas?

View 3 Replies

Actionscript 3 :: Calling MovieClip(root) From A Dynamic MovieClip Instance Produces Error 1034

Jan 14, 2012

For some reason, the same code works now, without any problem at all. I don't know what happened, or why, but I no longer have this problem Here's the original post: To put simply, I created a MovieClip, put it with addChild() to stage, and when I tried to call this piece of code:

[Code]...

View 2 Replies

ActionScript 3.0 :: Parent Movieclip Doesn't Listen To Custom Event In The Child Movieclip?

Oct 24, 2010

I have movieclip which contains child movieclip. when child movie clip finish to play i want to run a function in a parent movieclip. so I made a custom event dispatcher in the first frame of the child movieclip:

[Code]...

View 4 Replies

ActionScript 3.0 :: Call Parent MovieClip Function From Child MovieClip?

Mar 15, 2012

I have load child swf in parent swf, from child swf i am trying to run my parent swffunction I am trying this code

MovieClip(parent).testfun()
but this code is giving error.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@2b1aa061

[code].....

View 1 Replies

Flash :: Remove Parent Movieclip From Child Movieclip Ain Actionscript 3?

Mar 12, 2011

below shows how to add child in a movieclip. ebd.target.addChild(info_grd); there is button named my_btn inside the movieclip info_grd.I would like to remove movieclip info_grd.parent

View 2 Replies

ActionScript 3.0 :: Access A Movieclip Via Its Instance Name In Another Movieclip Class?

May 28, 2011

how can i access a movieclip via its instance name in another Movieclip class?

and a nother question how can i access a movieclip via its class name in another movieclip class?

BTW i want to access the movieclip child

View 4 Replies

ActionScript 3.0 :: Make A Reference To A Movieclip Instance That Is In Another Movieclip?

Jul 17, 2011

I am trying to make a reference to a movieclip instance that is in another movieclip.

Here's the deal: I have a main timeline for different pages of a website...then within that I make all of the art on each page into a movieclip so I can do animations every time that main timeline frame is called to, yet still keep my main timeline clean.

Within one page's movieclip I have a few buttons that I want to use to go to other pages by referencing them on the main timeline.I have been using this: (home_about is the about us button on my home page, and frame 31 is on the main timeline).

home_about.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_6);
function fl_ClickToGoToAndPlayFromFrame_6(event:MouseEvent) :void
{[code].............

Since this home_about is within another movieclip,I get the access of undefined property error. Do I need to change the code I've pasted above or add in variable definitions to fix this?

View 1 Replies

ActionScript 3.0 :: Accessing Parent MovieClip From Child MovieClip?

May 17, 2011

I'm trying to access a parent movieClip from the child movieClip

Here's what I want to do,

I've got a movieClip named wrong_mc, which plays for a couple of frames and on the last frame, its got a close button "close_btn" inside of it, now I wanna write the code such that when close_btn is played the movieClip "wrong_mc" should go and stop at frame1, I'm just not able to access this movieClip from the button.

View 5 Replies

CS3 Play (reference) MovieClip Instance From Within MovieClip

May 20, 2009

I am trying to create an interactive graphic. Basically, it's three squares layered on top of each other, with a large square in back, a medium square centered in the middle of the large square, and a small square in front centered in the middle of the medium square.

When you roll over the medium square, say, it expands to almost the size of the large square and some text fades in, and the small square on top of it fades away. When you roll off of the medium square, it goes back to it's smaller size, and the small square fades back in.

Currently, I have the actionscript in the movieclip to make the medium square get larger and smaller (and the text fade in), but I need to somehow reference the instance of the small square movieclip to hide it when I roll over the medium movieclip.

My actionscript for the medium square activity, currently:

Code:
stop();
this.onEnterFrame = function(){
if(rewind == true){

[Code]....


how to have this rolling over action get rid of the small square and then bring it back on roll out.

View 2 Replies







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