ActionScript 3.0 :: Can't Access Mc Child?
Jun 29, 2009
i've made a simple example here to show you my problem. I have basically created a stage object ("box"), with the nested children, box->b->c. I have exported box for as, with class "box" and base class movieclip. Now i create 4 instances of my box class and add an eventlistener to the nested child c. When i later on try to remove the eventlisterner for myinstance.b.c i get: TypeError: Error #1010: term is undefined and has no properties.at DocumentClass/removeSomething(). Here is my code:
package
{
import ....
[code]....
View 10 Replies
Similar Posts:
Aug 23, 2010
i have problem with swfLoader in flex, when i close following code in click method i can easly add many swf to main application
<mx:VBox id="content" width="100%" height="100%" ></mx:VBox>
public function doIT():void
{[code]....
when i close adding those swfs in loop i have the same error, it looks like child apps couldn't access certain objects that were instantiated by another child app, so what can i do?
View 1 Replies
Mar 11, 2010
I've seen some discussion on how to load a child swf using swfLoader and accessing it's variables but I am wondering if it is possible to do this without adding any code to the child swf.Either accessing public vars or listening for funciton calls would work fine
View 2 Replies
Jun 10, 2010
I have a mainSwf in which I load an external swf, which loads an external swf.( a child of a child). I am trying to set the framerate via AS3 for the childs child by using stage.frameRate= 15;
It doesnt work when the children are loaded into the mainSwf. how to access the stage of a child's child? I have tried root, Movieclip, this but can not get it to work
View 9 Replies
Jul 23, 2009
The error is as follows:1119: Access of possibly undefined property shiftX through a reference with static type flash.displayisplayObject.shiftX is declared in the first line of the movie clipFirst i check to see if the child doesnt exist and if it does I access it like so:getChildByName("ball"+ccc2).shiftX)
View 4 Replies
Mar 6, 2009
I am trying to add a child in a movie clip and perform basic operations on the child but I cannot get access to the child.
It loads the child to the movieclip "FLine1MC" but it says FLine1MC.ClipArt1 does not exist when I try to change the x location.
function AddArt1(evt:MouseEvent): void {
var ClipArt1Request:URLRequest = new URLRequest("images/mypic.gif");
var ClipArt1:Loader = new Loader();
ClipArt1.load(ClipArt1Request);
FLine1MC.addChild(ClipArt1);
FLine1MC.ClipArt1.x = 550;
}
Anybody know what's my error?
By that token, is there a way we can check the exact path of an object?
View 2 Replies
Oct 7, 2009
I am adding a movieclip in a class I will call class B that is added to a class I will call class A. In class B I am adding the movieclip like this:
var thumbHolder:MovieClip = new MovieClip();
thumbHolder.name = "thumb" + loadingCount;
MovieClip(root).slideMenuHolder_mc.slideMenu.thumbs_mc.addChild(thumbHolder);
trace("after: thumbHolder.name is: " + thumbHolder.name);
In class A, I can do something like this:
thumbs_mc.alpha = .3;
But if I try to do something like this, I get an error, even though the trace above traces out the names correctly. thumbs_mc.thumb1.alpha = .3;
View 6 Replies
Oct 14, 2010
On the main timeline I've got a movieclip, inside this movieclip I have some elements. Can I manipulate those elements from the main timeline through AS3? How?
View 3 Replies
Mar 9, 2012
I have a cloud named cloud2_mc and in its timeline i have a cloud layer, and an actions layer. I took the cloud and made it into a a Movie clip clip with an instance name of embeddedcloud_mc in this Movie clips timeline i have a 50 frame animation of the cloud breaking appart and disapating with a tween and i have a stop(); function on frame 1 of this layer.
What I want to happen is, when the cloud2_mc movie clip is clicked to play the animation of the cloud breaking appart. the cloud2_mc has a trajectory moving slowly accross the sceen continuously when the cloud2_mc reaches the side of the sceen it loops again. When the animation is clicked i would like it to continue across its path but, when the cloud2_mc reaches to left hand side of the screen i want the embeddedcloud_mc to reset its timeline and go back to its original state where the cloud has not broken appart.
My question is, how do I access an embedded movie clips timeline to tell it to play an animation on its timeline as well as, how do i make the same object restet its timeline to frame 1?
View 2 Replies
Aug 30, 2011
I am developing a shopping cart for my web store. What I am trying to do is initially a store front is rendered where a user selects the products and adds them to a shopping cart. The "cart" is a vector that holds all of the products selected. The user is then sent to a review page where he/she can review their order. It is then communicated to a PHP page for the final checkout and what not.[code]...
View 9 Replies
Sep 24, 2011
I want to access a my movieclip child but it doesn't work [code]...
View 4 Replies
Dec 13, 2011
I am adding movieclips (myBall) to the stage by the click of a button. There is a base class applied to myBall which allows it (and its children) to be dragged and dropped. Within the base class on mouse down, along with startDrag, the movieclip is being brought to the top index. I would like to be able to refer to this movieclip in my document class. The point of doing this would be to apply a function to the last clicked movieclip (finding what movieclip was last clicked would happen by applying the function to the movieclip (myBall) with the highest index).[code]...
View 7 Replies
Jul 22, 2009
I have a container with text and a button and an image.
When i Mouse over the button i want to be able to tell the text inside the container to change its TextFormat to another.
How do i tell the text to do so, i though it would be something within the MouseEvent like,
event.target.parent (someway to access other child).setTextFormat()
is their a simple way to access another child from within the same parent?
View 4 Replies
Feb 21, 2010
I'm using the code bellow:[code]The problem I'm getting and I can't figure it out in AS3, is how to call the "mcExt" from another function, outside the function where the mc is created.tried MovieClip(root).container_ mc.window_mc.mcExt.gotoA ndStop("exit"); and it does not work.
View 1 Replies
Mar 9, 2010
I am creating a fullscreen (no scale) site, so I am placing the position of my movieclips by referring the stage.[code]...
that code sets the x property of the movie clip fine when stand alone but when loaded into another swf it has trouble accessing the stage.
How can I access the height and width of the stage from a child swf? I have already tried both parent and root which give no errors, however they are not tracing proper values and are throwing everything in the wrong place
View 5 Replies
Apr 24, 2009
Can any tell me how can I access a sub-child of a MoivieClip using [ ] operator?
View 2 Replies
May 14, 2009
I have an mc called parent_mc.. inside that is child_mc... now if i do in AS2
parents = new Array();
childs = new Array();
parents = [parent_mc];
[code].....
View 5 Replies
Sep 10, 2009
Having this litle code, how do I access the erro textArea?[code]...
View 1 Replies
Jan 27, 2010
The following code is not working
function menuAct(event:MouseEvent):void { event.currentTarget.parent.removeEventListener(MouseEvent.MOUSE_OVER,
[code].....
View 4 Replies
Nov 10, 2010
I have the following code:
var myParent:Parent = new Parent();
var mySymbol_01:Symbol01 = new Symbol01();
var mySymbol_02:Symbol02 = new Symbol02();
[Code].....
and remove the comments, the file breaks and no Movie Clips appear on the stage. Does this have to do with casting the Children as Movie Clips, which I may not have done here?
View 5 Replies
Feb 11, 2011
it's very simple thing i have a swf file try.swf, and it have little bit animation, I stop it's animation on timeline frame 1and i use this code... to load try.swf in other flash fileimport flash.display.Loaderimport flash.net.URLRequestvar ld:Loader=new Loader()var rq:URLRequest=new URLRequest("try.swf")ld.load(rq)addChild(ld)now i hv load try.swf in ld Loader now I want when this loaded then try.swf gotoAndPlay though frame 2 and start showing animation.
View 1 Replies
Mar 15, 2010
I'm creating an actionscript project in Flex Builder. I succeed to export from Flash a SWC file, and to use it succesfully in Flex. I have a good programming background and Flex looks very simple for me, but I have difficult times in flash. I'm trying to achieve something that might be very simple(not for me of course): I create a simple shape in Flash, convert it to symbol. Then I create a TextField. The I select both the elements and convert them to another symbol, and Export it as a movieclip in swc.
In flex I want to change the value from the textfield. How should I do? I'm trying to do:
var t:ExportedMC = new ExportedMC();
t....(what should I write here)
As I mentioned when I open flash I feel like an elephant in a porcelain store. I have 2 questions here: - how to assign a name to the textfield in flash? I'm using CS4. - how to access it as a child in flex?
View 1 Replies
Oct 21, 2010
I need to access topBox's grandchildren and determine whether they're buttons or not. This function belowgrabs topBox's immediate children which are the HBoxes. How do I go one level lower to topBox's grandchildren? Or is the only way to do this is to run this function on each HBox?
for (var i : int =0; i<topBox.numChildren; i++){
var child : DisplayObject = topBox.getChildAt(i);
var myButton:UIComponent = child as UIComponent;
[code].....
View 1 Replies
Sep 11, 2011
So I am using this code to embed my .swf file. I am creating classes for each asset in my library.
[Embed('assets/assets.swf', symbol='game.menu.levels')]
public static const LEVELS_MENU:Class;
It works just fine but how can I access a child element multiple depths down?
[Code]...
View 2 Replies
Dec 22, 2008
I have to access a function in child swf from parent swf. This child swf gets loaded into a canvas object in parent.swf. Everything works fine but I'm unable to call any function that was in child.swf. My code is
Code:
var swf1:SWFLoader = new SWFLoader();
swf1.source = "CHILD.swf";
can.addchild(swf1);
I read on google and then I tried this in parent.swf's code
Code:
var myrequest:URLRequest = new URLRequest("CHILD.swf");
var myloader:Loader = new Loader();
myloader.load(myrequest);
canvas.addchild(myloader);
Now this one throws up a runtime error TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@5934b01 to mx.core.IUIComponent.
I also tried this
Code:
var myrequest:URLRequest = new URLRequest("CHILD.swf");
var myloader:Loader = new Loader();
myloader.load(myrequest);
[Code]....
But in this case my swf does not show up at all and there are no runtime errors too!
How do I resolve this error and how do I then access the function in child.swf?
View 9 Replies
Dec 26, 2009
I am loading one swf file in my application and after loading the child swf ,just i want to play one particular key frame in the child swf and the label names is called "start".
[Code]...
View 5 Replies
Jul 14, 2010
I know I can use ApplicationDomain to access child class.Strictly, likewise, can I done it without adding child swf to stage?
View 1 Replies
Jan 11, 2011
I have difficulty accessing a function inside a child object from parent.I've created an object named "dot" which has the following code in it:
ActionScript Code:
import com.greensock.*;
import com.greensock.easing.*;
[code].....
View 9 Replies
Mar 14, 2012
Basically, I want to access a movieclip child created in a function called 'main' in my 'main' class that links to the fla.
Code:
var player:Symbol3 = new Symbol3();
addChild(player);
[code].....
View 9 Replies
Jun 21, 2008
The external swf is located at:[url]....In the parent.swf, I put System.security.allowDomain(url....)When you click a button on the child.swf it's suppose to trace data from the parent.swf, but it returns undefined.What am I doing wrong? I MUST access data from the parent.swf
View 4 Replies