ActionScript 3.0 :: Target Of Multiple Movieclips?

Feb 13, 2012

i basically have some images of logs (for a bridge) setup inside a movieclip called log_mc, inside log_mc each log has its own movieclip log1_mc, log2_mc and so on

[Code]...

View 29 Replies


Similar Posts:


ActionScript 3.0 :: Drag And Drop Multiple Objects To Multiple Target?

Sep 10, 2009

im creating a small drag and drop game in AS3-
 
I have 4 objects and 4 targets,
 
I want to be able to drag any of the 4 objects onto any of the targets, right now all I can manage is to allow each object drop onto one specific target only.
 
I thought by calling all my target names by the same instance name eg target_mc that would work but only one target will ever work.

View 8 Replies

ActionScript 3.0 :: Tween MovieClips Using Target.name?

May 31, 2011

I think this solution should be simple but I think I am missing something about using event.target.name.I have multiple (over 30) MovieClip images on stage with alpha of zero and I would like to have them fade in on MouseEvent.CLICK while removing the current image showing. While I can code it to work for a single image I want to use this.target.name to have more efficient code.

[Code]...

View 3 Replies

ActionScript 2.0 :: Target Movieclips In An Array

Aug 27, 2007

i have an array called movieList that's made up of nine movieclips ("one_mc" for example). when something happens in my timeline, i want to send each of the movieclips to their fifth frame. i tried the following code and it didn't work:

[Code]...

View 2 Replies

ActionScript 2.0 :: Target Individual Movieclips?

Nov 19, 2007

in a actionscript file, is there anyway to have different codes target different movieclips? For example, if i want one movieclip to tint to red and another to tint to blue, can I do that in the same actionscript file or do I need to do that in separate actionscript file?

View 3 Replies

ActionScript 3.0 :: Target Specific Movieclips In An Array?

Nov 16, 2009

I did this:

Code:
var mc_array:Array;
mc_array = new Array(3);
mc_array[0] = mc1;

[code]....

I want to use arrays to shorten things, but I don't know how to get and set the properties of individual entries of the array (with a mouse click).

View 2 Replies

ActionScript 3.0 :: Event.target And Nested Movieclips?

Sep 23, 2010

I have a bunch of movie clips in my main timeline with at least 2 nested clips inside them, MyMc.nested1.nested2 etc. I have given the top most movie clips that sit on the main timeline instance names. In a document class I created a private variable typed as an array and placed all those MC names in that array. I then looped through the length of the array and assigned 2 event listeners to each instance. Example:

for (var i:uint = 0 ; i < _activities.length ; i++){    _activities[i].buttonMode = true;    _activities[i].addEventListener(MouseEvent.MOUSE_DOWN, pickUp);    _activities[i].addEventListener(MouseEvent.MOUSE_UP, dropIt);} 
 
in the event pickup() is were my trouble seems to come in.In the pickup function I have the following:
 
event.target.startDrag() 

This seems to work, but only on the lowest nested Movie clip......nested2I can use event.target.parent.parent.startDrag() and that seems to work.... Except when I place another movieclip in the second layer of the of the MyMC , if that is accidently clicked, it will now drag the Stage.I attempted to use the event.target.mouseChildren = false but that only seems to work on the lowest nested object... nested2 as that seems to be the one I am clickingIs there something I am missing to say, click only the top level mc then ignore all nested mc?

View 3 Replies

ActionScript 3.0 :: Target Dynamic Nested MovieClips?

Sep 5, 2011

I have been working with AS2 for a long time, but are a total newbie when it comes to AS3.On my stage I have placed an empty MC with instance name "holder".In my library I got a MC linked by the name "sektor".

"sektor" has several movieclips and buttons with instance name, e.g. "corner1", "corner2", "corner3"....

I have nested "sektor" inside "holder" by writing this code:

Code:
var newClip:sektor = new sektor();
newClip.name = "sektor1";
holder.addChild(newClip);

What I want to achieve is to control those movieclips inside "sektor" by turning dem on/off.I have tried to do this with this code:

Code:
holder.sektor1.corner1.visible = false;
but I keep on getting this error:
"TypeError: Error #1010: A term is undefined and has no properties."

I have figured out that by tracing holder, I know it�s excisting (Result: [object MovieClip]) but if I try to trace holder.sektor1, I got the result "undefined". So it seems like "sektor1" is not excisting. Why?

View 7 Replies

ActionScript 3.0 :: Flash For Loop Loading Multiple Images Into Multiple Movieclips

Feb 5, 2012

[Code].....

I have a group of 16 images that I would like to load 1 of each into each movieclip. I want image1 to be inside of visual1, image 2 inside of visual2, and so on. the images are named like, 1960s_(1).png where the 1960 (year) part is coming from the rangeNum variable. The above gives me this error: 1061: Call to a possibly undefined method addChild through a reference with static type int.

View 4 Replies

ActionScript 2.0 :: Target Dynamically Loaded Movieclips For Rollover?

Jan 3, 2007

I have a script that loads images and text from an XML file into movieclips.The following code is what creates the movieclips that contain the elements:

Code:
var thumb_mc:MovieClip = _root.mc_conteudo.createEmptyMovieClip("thumb"+(1+i), _root.mc_conteudo.getNextHighestDepth());
var img_mc:MovieClip = thumb_mc.createEmptyMovieClip("img", 0);

I can't seem to find a way to target the thumb_mc or the img_mc so they have rollover effects and actions (they are created for each set in the xml file, so there are multiple mc's)mc_conteudo is the content mc that scrolls.The swf is here: http:[url].....

View 13 Replies

ActionScript 3.0 :: Target Of EventListeners - Possible To Change MovieClips Image

Nov 7, 2011

I've made a loop that is creating 9x movieClips that is loading external images and I have also added eventListeners to those movieClips to make it possible to change the movieclips image. My problem is that i can't access the target of the "first eventListener". Here is the code to browse for the new image, i want to access the movieclip of this function in a later eventListener, like this: event.CurrentTarget

Code:
file.addEventListener(Event.SELECT, onFileSelected);
function mUp(event:MouseEvent):void{
file.browse(new Array(new FileFilter( "Bild (JPG och JPEG)", "*.jpg;*.jpeg;")));
}

The second eventListener. This function is called when the new image is selected
Code:
function onFileSelected(event:Event):void{
file.addEventListener(Event.COMPLETE, loadCompleteHandler);
file.load();
}

The third and last function, this function is called when the image is loaded and is ready to be used.
Code:
function loadCompleteHandler(event:Event):void{
file.removeEventListener(Event.COMPLETE, loadCompleteHandler);
var loader:Loader = new Loader();
loader.loadBytes(event.target.data);
// Here is the problem!
event.target.addChild(loader)
}

If if put this code, it will target the second function's event.
Code:
event.target.addChild(loader);
I am searching for a code looking like this to replace the old image with the new one
Code:
event.target.target.addChild(loader);

View 5 Replies

ActionScript 3.0 :: Loading Multiple Images On To Multiple Movieclips?

Sep 16, 2009

I have 50 images that need to be on stage, which will be embedded into 50 different movie clips. I named the movie clips image1-image50 and the images are in an external folder named 1-50. Every freaking article or tutorial I have found clearly explains how to upload one image, or just one at a time. I can do that, and spend 2 days renaming all the functions, but I do not want to do that. Is there a better way to just load all 50 images, place them accordingly?

View 3 Replies

ActionScript 3.0 :: Load Multiple Images Into Multiple MovieClips?

Oct 26, 2009

I have 24 movie clips on the stage: my_menu.image_holder_mc1 thru my_menu.image_holder_mc24. I want to load an image in each one. How do I identify the holder which to add a child.

The Code I have so far is....

Code:
for (var i:Number=1; i<=24;i++){
var myLoader:Loader = new Loader();
myLoader.name = "image_"+i;

[Code].....

View 2 Replies

IDE :: Add Multiple Target Types?

Nov 24, 2009

I've been working on a cute game and I've hit a bit of a wall

It's a shooting gallery game and I want to add multiple target types (so far this has been easy) but I want to game to randomly bring them up as you play. There are four possible target spots and seven possible targets:

baddie1
baddie2
baddie3
baddie4
baddie5
baddie6
goodie1

View 2 Replies

ActionScript 2.0 :: How To Target Multiple Buttons

Aug 6, 2006

[code]I can contorl the current selected mc.like myButton1.But How I can control the other button action at the sametime.like myButton1._alpha =50, myButton2,myButton3,myButton4...._alpha = 30.

View 5 Replies

ActionScript 2.0 :: Target Multiple Instances With One HitTest?

Jun 7, 2010

[Code]..

I want to use the above code (obviously with more meat inside of it) on multiple instances of the same symbol, but when I name the instances "wall" only one of them actually performs the hitTest. Is there a way to pull this off without having to perform a hitTest on every instance?

View 0 Replies

ActionScript 2.0 :: Any Way To Target MovieClip Other Than Using Multiple Parents?

Apr 25, 2004

I have several buttons on an externally loaded swf that work fine but I'd like to clean up the code if possible. Is there an better way to target the mc other than using multiple _parents?

Code:
on (rollOver) {
_parent._parent._parent._parent._parent._parent._parent.expression.gotoAndStop (2);
} on (rollOut) {
_parent._parent._parent._parent._parent._parent._parent.expression.gotoAndStop (1);
}

The thing is I am not exactly sure if this mc is going to remain an external swf or if it will eventually stand alone, which is why I haven't targeted the root at its level. I'd like it to work either way if possible.

View 1 Replies

ActionScript 2.0 :: Target Multiple Movie Clips At Once?

Jun 29, 2006

how to target multiple movie clips at once so that if my tank bumps into a specific set of movie clips, it will change my move var to false without having to put a hittest on each individual movie clip and without having to list out all their names? I don't want to list fifty different instance names for all the hittests.

View 1 Replies

ActionScript 3.0 :: Multiple Hit Target For Drag N Drop?

Nov 7, 2009

1. I created the dropzone script, in which has to be dynamic in size so that people can the tiles to design their floor board. Problem is, if the dropzones are too close to each other, the app has problems deciding where to drop the tile. (the tile floor is diagonal, imagine a diamond looking tile) I dont know what to do in order to securely place tiles where it shuld be... the dropzones are too close to each other..!the tile can either be full tile, 1/2 and 1/4 tile. How do I do this? I managed to get the drag n drop for full tile to work, but I dont know how can I do it with 1/2 or 1/4 tile. Should I split the dropzones into 4 sections? If I did, then I'll have a problem with full tile? For dropping let say, a pyramid-shaped tile onto a Full Tile would be very2 confusing

View 1 Replies

ActionScript 3.0 :: Target Multiple Datafields In A Data-grid?

Feb 23, 2010

I have a data-grid which is pulling information from a database through php (zend-amf)[code]...

View 2 Replies

ActionScript 3.0 :: Drag And Drop Multiple Items To One Target

Jul 15, 2010

I'm trying to create an interactive game where multiple movieclips can be dragged onto a single target. I understand that the target and the movie clip have to have the same name, like "book_mc" has to have a target of "targetbook_mc", but is there another way to do this so that "book_mc" and "pencil_mc" can both have the same target?

View 4 Replies

Actionscript 3 :: Multiple Draggable Item Into A Single Target

Oct 13, 2010

I'm creating a drag and drop Flash activity where there is 1 target and multiple draggable items. In my case I have 4 apples and I want to be able to put all apples into the same basket. I can get the draggable item into one target but i cannot get multiple draggable items into one single target.[code]

View 1 Replies

Eclipse :: Multiple Target Devices For A Single Project?

Oct 27, 2011

I am porting an existing project from Flash Pro to Flash Builder.The code is almost completely portable between Web/Android/Projector/AIR, and I simply change a few constants for each target device before hitting publish...However- in Flash Builder, it asks me when creating a project whether it will be mobile or web.What's the best-practices way to target multiple devices from a single project in Flash Builder?OR, in Flash Builder, must they each be their own project? If they must each be their own project- is there a multi-project organization method which works well, keeping in mind that in this context each project is really just a different build of the almost-identical codebase (On one foot- I thought of having a "common" project

View 1 Replies

ActionScript 3.0 :: Drag And Drop Multiple Objects, 1 Target?

Feb 9, 2010

I have been trying forever to figure out how to add multiple mc's (images) with different instance names to 1 target only (another image). All of the mc's and the target are placed on the same layer. All I want it to do is snap different images to the same target. I have tried placing the target on a seperate layer but it does not work either.

Here is the code:

ActionScript Code:
cat_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
cat_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
dog_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);

[code]....

View 2 Replies

ActionScript 3.0 :: Getting Multiple Random Objects To Aim For The Same Target From Library

Apr 1, 2011

With some excellent help from ilike2 I was able to import random objects from a library that can then be dragged to their respective targets (on repeat). However, I forgot to mention that I need to drag more than one of these objects onto the same target and I don't know how to change the actionscript to accommodate this. Would anyone be able to help me with this? In the example below I would also like Blue2 to target targetBlue_mc Here is the code:

[Code]...

View 4 Replies

Professional :: Drag Drop Objects To Multiple Target Areas?

Oct 30, 2010

I am trying to make a quiz on metals. I have several elements which i want to fall into multiple target areas (e.g. the target areas are shaded grey in the following swf; metal_mc, nonmetal_mc, metalloid_mc). I can make individuals match to target areas (as there are tutorials for that) but i want each one to be able to slide in to any target area (and someday i want to create a solve button which will then place each element in the correct place). have started all over and have designated only chlorine to move (for the moment) but how do i code it to allow it to fall into any of the grey areas?

var objectoriginalX:Number;var objectoriginalY:Number;chlorine_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);chlorine_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);function

[code].....

View 6 Replies

ActionScript 3.0 :: Drag And Drop - Multiple Objects On Single Target?

May 16, 2011

I want to create an interactive learning module that would use a simple drag and drop test. I've already browsed the net for guides and it led me to monkeyflash.com that gave me a very helpful guide. On the guide, there can only be one object be dragged to a target. But then, I wanted my test to have multiple objects (movie clips) be dropped on a single target (also a movie clip) only and stick to it. I'm thinking that I could place my draggable objects on an array, but I really had difficulty on executing this.
 
On the code below, a drag object can only be placed on one target only (i.e dragIn1 can only be dropped on targetdragIn1 but not on targetdragIn2). Yet, I want all dragAt objects be dragged on all targetAt, dragIn with targetIn, and dragOn with targetOn.

[Code]...

View 2 Replies

Flex :: Move Effect Only Animating Last Target In Array Of Multiple Items

Feb 5, 2011

I am animating a number of items using the Move effect. I am adding each item to an array after it has been added to the display list and once all items are added calling the play method, passing an array of the items to it. Only the last item plays in my animation.

Here is my code:
MXML: s:Move id="coinFall" yFrom="-400" duration="2000" />
public function showCoins(n:Number):void{
holder.removeAllElements();
var targets:Array = [];
if (n>=2.5){
[Code] .....

View 1 Replies

ActionScript 3.0 :: Multiple Buttons Share Single Loader For Loading Each Of Their Target Contents?

Jun 26, 2009

I am trying to have one single loader for different buttons to load their specific target. lets say I have btnOne and btnTwo, each of them have their page to link to, btnOne to pageOne, btnTwo to pageTwo, page one and two are external swfs. so can I load them into stage by sharing one single loader?

this is simply my script:

ActionScript Code:
var swfURL:String = ("external.swf");
btnOne.addEventListener (MouseEvent.CLICK, startLoad);
btnTwo.addEventListener (MouseEvent.CLICK, startLoad);

[code]....

View 2 Replies

ActionScript 3.0 :: Multiple Buttons Share Single Loader For Loading Each Of Their Target Contents

Jun 26, 2009

I am trying to have one single loader for different buttons to load their specific target.lets say I have btnOne and btnTwo, each of them have their page to link to, btnOne to pageOne, btnTwo to pageTwo, page one and two are external swfs. so can I load them into stage by sharing one single loader? this is simply my script:

[Code]...

View 2 Replies







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