ActionScript 3.0 :: Targeting Objects Via AddChild?

Aug 24, 2009

I'm trying to target elements placed on the stage with this line:

trace(mc_image_1.x);

But it keeps on giving errors. I looked at some earlier posts but couldn't find a solution.

Code:
var thumbNails:mcThumbNails;
// PLAATSEN VAN DE THUMBNAILS
for (var i:Number = 1; i <= 9; i++) {

[code]....

View 0 Replies


Similar Posts:


ActionScript 2.0 :: Targeting Objects Between Swf's?

Jan 28, 2011

So i have multiple swf's that are within a stage. The main swf (index.swf) has a menu and once clicked it makes another swf to display. A common issue i'm having is that for the other swf's. I have animations which work within that swf but when i run from index they don't work.I know this is because of the targeting of the object but how do make this work?ample on 5.swf i have a button that has an action, when a mouse cursor goes over it a photo fades in and out on it, and that works when i run 5.swf

View 9 Replies

ActionScript 2.0 :: Targeting Objects In Classes

Feb 7, 2005

I've got a problem targeting objects is AS2 classes. In a class I have a multi-dimensional array with paths to some mc's in the main timeline (caminho['mc']). I need to reference them via method in a class, so i use something like this:

[CODE]...

View 7 Replies

ActionScript 3.0 :: Drawing App - Targeting Objects In An Array

Sep 7, 2009

This seems like it should be fairly simple, but for some reason Im getting caught up when it comes to removing a layer from my drawing app, and when moving the layers up and down in the display list. My first problem is that when I do the (canvas.removeChild(layers[value]); it removes the child of the targeted layer, but it also removes the child of the objects before it? I think anyways.

The second problem is that my layerUp function works, but my layerDown does not, even though they are the same code? Confused I am indeed. I'm sure its fairly messy since Im just learning this stuff, so sorry for that too!

[Code]....

View 0 Replies

ActionScript 3.0 :: Flash Dynamic Objects And Array Targeting?

Dec 18, 2011

I'm trying to create a movieclip from the library dynamically on a certain event and then being able to target one specific movieclip by name after they've been created. I'm having problems being able to target and have tried a tone of different approaches, I think I'm close but I'm getting the error '#1006: getChildByName is not a function.'

Code:
package {
import flash.display.*;
import flash.events.*;

[code]....

View 14 Replies

ActionScript 3.0 :: Dynamically Name Objects In A For Statement Using AddChild?

Jan 26, 2009

I was wondering where did go the for statement with attachMovie from library in AS 3.I mean i was having in AS 2:

for (i=0; i<5; i++) {
attachMovie("sim", "sim"+i, i);
}

Now in AS 3:

for (var i=0; i<5; i++) {
addChild(new sim());
}

I can't figure out how to name every instance of the "sim" object from library that i add to the stage without using string.How do I dinamically name the added instances of the object from the library for future reference and usage throughout the code?

View 9 Replies

ActionScript 3.0 :: Listen For Objects Created By AddChild?

Feb 10, 2010

i created a "for" function who īll display an X number of buttons with addChild, and give a name for each using button.name = "name" + variable but later if I want to listen for the buttons using their name donīt work, already know that there is getChildByName so i tried but give me the same error who tells that there no object with that name.My question is, how i can listen for the objects created if i already have a name for each one of them? here is the code im doing.
 
for(var i:int = 1; i <6;i++){var miBoton:boton = new boton();var miTexto:TextField = new TextField();miBoton.x = i * miBoton.width + (i* 10);miBoton.y = 20;addChild(miBoton);miBoton.name = "boton" + i;miTexto.text = "hi";miBoton.addChild(miTexto);trace(miBoton.name);trace(miBoton.parent);}

View 6 Replies

Actionscript 3.0 :: Accessing AddChild Objects Indiviually

Dec 15, 2009

I'm a seasoned AS2 developer who's been dragged kicking and screaming into the world of ActionScript 3.0. I'm working on revising an old project coded in AS2 that needs to be re-coded in AS3 and It's been slow going. I have a question regarding addChild (attachMovie) function. My scenario is as follows: I'm pulling data from an XML file that dynamically builds a scroll list from items in the library. Each item in the list has an individual button function attached to it. I'm generating my list just fine, but I can't access the items as individual buttons. Instead, it seems that the entire list has the properties of the last child added.

[Code]...

View 3 Replies

ActionScript 3.0 :: "addChild" Using Objects Name?

Jun 7, 2011

How can I "addChild" using objects name? For example:

var kont:MovieClip=new MovieClip();
kont.name="kont1";
addChild(kont1);//

View 1 Replies

ActionScript 3.0 :: AddChild From A Class - Get The Error "1180 : Call To A Possibly Undefined Method AddChild?

Jun 15, 2011

I'm trying to have a class file which can add objects to the stage via addChild; however, when I call addChild from within the class file, I get the error "1180: Call to a possibly undefined method addChild." I've tried importing flash.display.* and that doesn't fix the problem. Does the class file have to extend Sprite or MovieClip to be able to add objects to the stage?

View 8 Replies

ActionScript 3.0 :: Box2d Addchild - 41061: Call To A Possibly Undefined Method AddChild Through A Reference With Static Type Class

Jan 16, 2012

I have downloaded Box2d ([URL]) and created a project that looks like this: [URL]. catalyst is the green cube and it has the base class "shapes.box", it is inside "world" which has the base class "wck.World". What i want to do is to add another "catalyst" from the library inside "world" when i click on add_btn. I tried to accomplish this by this code:

[Code]...

Symbol 'buttons', Layer 'Actions', Frame 1, Line 41061: Call to a possibly undefined method addChild through a reference with static type Class.

View 9 Replies

ActionScript 3.0 :: Difference Between Mc.stage.addChild And Mc.addChild?

Jan 20, 2011

I have the followings:

_p:Player (which is a MC)
a1:Animation1 (which is a MC)
_p.addChild(a1); //doesn't display anything
_p.stage.addChild(a1); //displays a1

Why won't the MC display a child without using his stage?

View 1 Replies

ActionScript 3.0 :: Difference Between AddChild And Parent.addChild?

Aug 11, 2009

I'm trying to resolve an issue that reared it's ugly head yesterday.Frame one of main timeline I have the following code:

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

[code]....

The newMC doesn't show up.If I add 'parent.' in front of the addChild then it appears.mc_LibItem has a base class of "flash.display.MovieClip" and is exporting for ActionScript and on frame one.For grins I created a new .fla and began messing around with the same addChild idea and it worked.

View 14 Replies

ActionScript 3.0 :: AddChild, RemoveChild And AddChild?

Oct 30, 2005

somewhat understood the basics of adding and removing children, however, I am facing another problem. After using the removeChild Function, I can't seem to add another child.For example:

ActionScript Code:
var attachedMC = new (getDefinitionByName("Content1") as Class)()
Page.addChild(attachedMC);

[code].....

View 3 Replies

ActionScript 3.0 :: Load External SWFs, AddChild(Loader) Versus AddChild(Loader.content), Etc?

Jul 29, 2009

I have a main "shell" swf which, by clicking several buttons, will load/unload various external swfs into a Placeholder_mc which resides on the main timeline in Shell.swf In the documentation and tutorials I've seen a couple different methods, and I'm not sure I quite understand the difference, or at least the reason you would use one over the other...In the 1st method, you can just add the Loader object using the addChild() method:

Code:

var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);
Placeholder_mc.addChild(myLoader);

This will apparently add myLoader to the display list once it has completely loaded.The 2nd method, you supposedly can add the Loader.content; however, it appears you can only do this once the content has completed loading, so you need to incorporate an event handler with the contentLoaderInfo object:

Code:

var myLoader:Loader = new Loader();
var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf");
myLoader.load(myURLRequest);

[code]....

What are the pros/cons of adding the entire Loader object, as opposed to the Loader.content and vice versa?

View 7 Replies

ActionScript 2.0 :: Targeting A Mc With Within A Mc?

Mar 2, 2006

I have made a navigation that is a movieclip, now within the movieclip are 6 movieclips that are the "buttons" of the navigation. This is then placed on the maintimeline as the movies navigation. When one of the "buttons" is pressed i want it to go to a specific point on one of the 6 movieclip "buttons" timeline. This is the code that I have used before on the maintime line to target a movieclip there... but never a mc within an mc. First, would I still place this code on the maintime? or within the mc that the 6 mc buttons are placed? Second how would I target the nav buttons mc's?

stop();
but1.onRelease = function() {
this.gotoAndStop(9);

[Code]....

View 2 Replies

Flex :: Objects Drawn By Flash Graphics Class Exist As Objects?

Jan 16, 2011

Internally Flash obviously keeps a list of the primitives drawn using Graphics so I wondered if you have many such primitives in a Sprite, can you re-position/remove/alter individual items rather than clear and re-draw everything? Or is this deeper into the bowels of Flash than you're allowed (or recommended) to go?

View 4 Replies

Php - Flex Is Deserializing Generic Objects From Zend AMF Instead Of Strictly Typed Objects

Mar 4, 2012

I'm using Zend AMF to send my remote objects to Flex. I've defined a Constant class and created getASClassName() method. Then I've created Action script class in flex.

Objects are send successfully, but they are deserialized to generic Objects in Flex instead of specific ones. EDIT: On network monitor in Flex I can see that AMF value is set to com.my.project.valueobjects.Constant. Although array from event.result contains Objects.

[Code]...

View 1 Replies

ActionScript 3.0 :: Does Setting An Array Of Objects To Null Erase The Objects From Memory

Apr 27, 2010

I have an array of temporary objects created in a for loop. The objects are of type class "Tile", a class I created. However, it appears that whenever I create a lot of tiles in the for loop, the program slows down indefinitely.

While the array is whiped at a later trigger point, I am thinking that perhaps these Tile objects are not being erased from memory. They are being created on the fly in a for loop, and the array is being reset to "array = []".

Are the objects still in memory or are they cleaned up when the array is set to []?

View 3 Replies

ActionScript 3.0 :: Objects Class Find And Change Another Objects Xy Properties?

Oct 13, 2010

What I have is a game with a Level object, inside the Level is a Player object, and they don't have instance names given, what I'm trying to figure out is how to do is make it so that the player can change the x or y properties of the Level object.
 
To be more precise, I'm making it so that when the player moves in a certain direction, he either moves accross the stage, or he starts moving the Level object around the stage, it'd be in an Event kind of function, now I can easily make the Player move, but I don't know how to make the Level object move which the player is inside of.

View 3 Replies

Flex :: Converting Array Of ObjectProxy Objects To Custom Objects?

Jun 10, 2011

I have a service which returns an Array of ObjectProxy objects. I would like to cast this to a custom object (a value object) and create an ArrayCollection. How can I do this?ited:I am using Django and PyAMF for the backend. I had to write a custom SQL query and I am wrapping the resulting records in ObjectProxy and sending the whole result as an ArrayCollection.Here is my client side code:

[ArrayElementType("SessionVO")]
[Bindable]
private var _list:ArrayCollection;

[code]....

View 2 Replies

Java :: Why Value Objects Coming Back As Generic Flex Objects

Aug 4, 2011

I will try to give as much detail as I can. I am creating an CRM application using Flex(Cairngorm 2)/Java/Hibernate. The basic problem I am having is this: I have a Customer class in Java that has an ArrayList of Address classes. I have a Customer class in Flex that has an ArrayCollection of Address classes. When I make the remote object call for a Customer I get back a Customer object in Flex, but the ArrayCollecion objects have a data type of Object instead of Address. If I try to call for a List of Address classes I get the same result. If I try to call for a List of Customer classes I get a list of Customer classes in Flex. Using tomcat 6 with the following jars:

[Code]...

View 1 Replies

ActionScript 2.0 :: Aligning Variable Sized Objects And Objects Inside Them

Jun 29, 2006

How do I align a movieclip, which width and height is user-defined, inside another object (this one is static, though). Top-left alignment is easy, x=0 and y=0, but what about center, center left, bottom left, etc? Math(.round) i suppose, but how?I want an object (static) inside the movieclip (user-defined) to stay aligned to, for instance, the top right corner, similiar to the minimize, maximize and close buttons at the top right of your browser.. The height and width data is pre-defined by the user in another file.But that does probably not make any difference...

View 3 Replies

ActionScript 2.0 :: F8 Targeting Gets Lost

Jan 15, 2009

I've got a dynamic textfield clip which is placed twice on the stage. It also includes a button. Funny thing is, the first trace works (tracing its _y value: 0 for clip 1 and 200 for duplicate clip 2). When I press the down button of both clips however it traces undefined though it's the same line. How does onPress mess up the targetting of both clips? [code]

View 6 Replies

ActionScript 3.0 :: Targeting A Loaded Swf

Nov 11, 2009

1. I'm loading an external swf onto my main swf.
2. Then I'm tweening an object which is separate to the loaded swf.
3. When the tween has completed I'm calling a function to make the loaded swf gotoAndPlay(2);

[Code]....

View 8 Replies

Targeting Label In External SWF?

Feb 12, 2010

I have 2 SWF (swf1 and swf2). I want to load swf 2 into 1, but getting it start on a label or a particular frame.I use this to load SWF 2

Code:

on(release){
loadMovie("movie2.swf",0);
}

How do i target it to start from a label in a scene from movie2.swf?

View 3 Replies

ActionScript 3.0 :: Targeting MC Already Placed On Stage?

Apr 28, 2011

I'm trying to target an MC that is already placed on the stage (as opposed to adding it from the library).

But I get this error:

Quote:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com::Test()
at objects_fla::MainTimeline/frame1()

[Code]....

View 5 Replies

ActionScript 3.0 :: Targeting An Instance Of A Mc?

May 27, 2009

With AS2 I u sed to do  createEmptyMovieClip("name"+i, to create multiple instances of an mc. I ocuuld then target these individual instances

[Code]...

View 4 Replies

ActionScript 3.0 :: Targeting An Event From A Different MC?

Feb 4, 2011

I made a  play/pause button for this project I'm working on (basically a slideshow with a different movieclips on each frame) and I have managed to get it to  target either the main timeline or a nested MC. The problem is with the  code I have is that the button will only work for one MC at a time. This  means I will need a separate play/pause button for each individual  slide. Is there some way to make a button that globally starts and stops  any MC without effecting the main timeline?
 
Here is the code I am using now:
 
stop(); 
pause_btn.addEventListener(MouseEvent.CLICK, stopplaying);function stopplaying(event:MouseEvent):void {    MovieClip(parent).green.stop();    gotoAndStop(2);}
 
Ned proposed adding an event at the beginning of each movie clip and programming the play/pause button to work that way. My problem (after spending a lot of time with it) is that I can't get my play/pause button (a MC itself) to target the event in a separate MC. 
 
This is my event placed on the first frame of my movie clip:
 
dispatchEvent(new Event("imHere"));
  
This is the code I have in the play/pause button that doesn't work:
 
stop(); 
pause_btn.addEventListener(MouseEvent.CLICK, stopplaying);function stopplaying(event:MouseEvent):void {    gotoAndStop(2);}

[Code]....

View 8 Replies

ActionScript 2.0 :: Targeting SWF From Another One In ECard

Jul 31, 2009

I am building an ecard, and I created two swfs. The first swf is the actual ecard, with a dynamic text box that is going to display the message. The second swf is where you would actually type in the information, such as name, email, and message. Is it possible for two swfs to "talk" to each other inside an html document? Also, I am not quite sure how to send the card to someone's email. I am assuming that when you hit SEND it reads the input box with that email, but not sure how that works.

View 1 Replies







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