ActionScript 3 :: Calling Children Inside MC - GetChildByName / GetChild At?

Jul 20, 2010

I found out that I can't target a object inside the main MC if I use getChildAt / getChildByName. It will return me
Error #1119: Access of possibly undefined property someProperty through a reference with static type flash.display:DisplayObject.

I was trying to use something like
this.getChildAt(0).getChildByName("objectName")....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Get UIComponent By Id Or Name, The GetChildByName Does Not Return Childrent Of Children

Sep 23, 2009

My application will load an xml file that has the name or id of a UIComponent. Later this will be used to set text or images.
 
This component could be on a panel or a panel in a panel, I am not familiar with flex but in javascript getElementByid would return the element wherever it is on the document (when called on the document). There is no get....Byid in fex and getChildByName does not look in children.For example

<mx:Text name="works" id="works"></mx:Text>    <mx:Panel>        <mx:Panel>            <mx:Text id="noWorkie" name="noWorkie" text="a test"></mx:Text>        </mx:Panel>    </mx:Panel>
this.getChildByName("works"); // worksstage.getChildByName("works"); // returns nullthis.getChildByName("noWorkie"); // returns null
  
Thinking of creating a getElementByid but has to be called from the top element, have no idea what the top element is.
For example this.root does not have a getChildren method to go through nor does stage. Guess I need to find the highest possible Container class starting with this.parent.There must be a "simple" way to do this but all examples I could find would not go from top level to lowest child as javascript would do in document.getElemetByid.

View 7 Replies

ActionScript 3.0 :: GetChildByName Mc Inside Mc

Feb 28, 2009

I'm trying to declare a movieclip variable in a class by finding the instance name of the movieclip.

On my stage I have a 'Container' (linkage class name) MC, inside that is a 'PlayerInfo' (linkage class name) MC inside that is a 'healthBar_mc' (instance name) MC. healthBar_mc is what I'm trying to access.

the class where I'm trying to run this function is linked to a MC inside 'Container'

So I tried the following code:

[Code]....

View 11 Replies

ActionScript 3.0 :: [CS4] Children Inside Children - 1119: Access Of Possibly Undefined Property NumChildren

Jan 12, 2011

I have a Sprite called pageContent. Inside pageContent are 12 more Sprites with unique names, a couple of Buttons, and some TextFields. Inside each of the 12 Sprites I have either one or two TextFields and one TextInput. My question is, since they are children inside a child of pageContent, how can I access them? Here is how I am trying to do it:

[Code]...

In my mind, this should totally work. But surprise, surprise, it doesn't. I have debugged it and it works fine for the first two lines, but when it tries to get numChildren of a Child of pageContent (line 3), I get this error: PHP Code: 1119: Access of possibly undefined property numChildren through a reference with static type flash.display:DisplayObject.

View 4 Replies

ActionScript 3.0 :: Calling On Children Through A Loop And Using E.currentTarget

Aug 25, 2010

I have a number of MC's that I've assigned listeners to through a loop that references an xml table.
 
//create listeners for all biketrails mc's and designate functionsfunction createListenersbk():void{for(var i:uint=0;i<bktrlXml.row.length();i++){var mc:MovieClip =

[Code].....

I thought I'd be able to replicate the above code and somehow refernce the "idlink" children through the e.curentTarget. 

View 1 Replies

ActionScript 3.0 :: GetChild By X, Y Position?

Feb 21, 2011

Is there a method that does this that I just cant see? I have two uints which represent an x, y position of an unknown object. I need a way to figure out what is that object at the known x and y position.
 
I've tried getObjectsUnderPoint which returned: [object Shape],[object Shape]
 
it's correct that there are two objects but doesn't tell me specifically what they are.

View 2 Replies

ActionScript 3.0 :: How To Get The Path Or Filename Of GetChild

Aug 19, 2010

Does anyone here knows how to get the path or the filename of an object inserted to the stage?

Here's the scenario:I'm developing a flash app, that enables the user to insert background to the stage by using the Browse and select using the FileReference in flash. I have successfully inserted whatever image the user choose, but what i'm trying to do is that if the user clicks save, the background image that he/she has selected will be copied to another folder on the web (uploads folder). Thus i need to know the path and filename of the background image.

[Code]...

View 7 Replies

ActionScript 3.0 :: GetChild (Index) But With X And Y Coordinates

Oct 11, 2011

I was just wondering if there is a way I can get the same info as the flash.display.getChild() Method, but providing the x and y co-ordiantes of a object.

View 7 Replies

ActionScript 3.0 :: Xml.children() Returns Grand-children And Gr8-gran-children?

Nov 18, 2009

I'm making a OSX-finder-type file browser in CS4.The Structure for the folder and files is being generated by a PHP in a XML, heres an example:(sorry the xml is not sorted, but the command i'm using in php doesn't sort it)

Code:
<root>
<dir name="images">

[code]....

View 2 Replies

ActionScript 3.0 :: Remove The Children For All The Buttons Inside Array

Mar 21, 2012

So i have a calculator and converter on two different scenes. I have two arrays which i stored for my number and operator buttons. I am using a button function to switch between scenes and would like to remove the children for all the buttons inside that array however it only removes one button inside the array. This is the code i have so far: My buttons:

[Code]...

View 1 Replies

Actionscript 3 :: Modify Position Of Children Inside Loop?

Mar 3, 2010

I'm trying to make a dynamic image gallery from and xml. From my tutorials, right now i've got it so it will constantly add the next thumbnail below the other, which is fine, but I'm trying to figure out how to make it that once it reaches a certain y coordinate, it will move the x coordinate over and stack them again. So that rather one long list of thumbs, it will be a side by side stack. For some reason, I can't get it in my head how something like this would work. My goal is to have a side by side stack that I will end up putting in a movie clip that will be masked to show only 2 stacks at a time. Then when clicking a button will slide it over. I was planning to use the "movieclip.length" to calculate how far over to move it, but i haven't gotten that far yet. This is what I got:

[Code]....

View 1 Replies

Flash :: Address The Object That Has Been Clicked But Not The Children Inside It?

Aug 5, 2011

inside a MouseEvent.CLICK function, I usually used e.target to address the movieClip that I clicked, but that only work with a movieClip that doesn't have any children (such as text and other symbols) inside. When it has children inside, the e.target return the child inside the Mc but not the Mc itself. The e.currentTarget didn't work, either; it returned [object MovieClip] but not the instance name of the Mc.

View 3 Replies

ActionScript 3.0 :: Scale Container MovieClip But Not Children Inside

Jan 15, 2010

What's the best way to scale a container mc but not scale the children inside it? Basically I have a box mc with a background colour, with a logo added using addChild, if the user changes the browser size the box scales to the height of the window but it's also scaling the logo, I just want to change the height of the container box really.

View 4 Replies

ActionScript 3.0 :: Swap Children Of Stage From Inside A Child?

Apr 26, 2008

I have 9 movie clips which are all of the same object, they get larger or smaller as the mouse gets closer to their respective centers. The functionalilty for this is in an AS3 class file that extends flash.display.MovieClip.How do I go about swapping depths so that the largest one is in the foreground, I am new to AS3 and dont seem to be able to find a way of getting the depth of the movieclip I am currently inside (this) and if I try to access the stage to call swapChildren I get the following runtime error:

View 6 Replies

ActionScript 3.0 :: Remove The Children For All The Buttons Inside The Array

Mar 21, 2012

So i have a calculator and converter on two different scenes. I have two arrays which i stored for my number and operator buttons. I am using a button function to switch between scenes and would like to remove the children for all the buttons inside that array however it only removes one button inside the array. This is the code i have so far: My buttons:

[Code]...

View 2 Replies

Flash - Make Sure Children Stays Inside Parent Movieclip's Shape?

Mar 17, 2010

Red: Shape inside parent movieclip,

Yellow: Children inside parent movieclip

I'd like to animate the yellow dots, but make sure that they never gets out of the red shape's boundary.

View 3 Replies

ActionScript 3.0 :: Calling An .swf Inside An Other .swf?

Dec 16, 2009

I have a problem calling an .swf inside an other .swf. This is what i have:I have 3 files organized like2) pruebaLivestream.swf3) pruebaLivestream2.swfIn the file 2 i call functions from livestreamPlayer.as and when i play this .swf it works perflectly.When i call the file 2 in file 3 it gives me this output:TypeError: Error #1009: Cannot access a property or method os a null object reference.

at com.livestream::LivestreamPlayer()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()

[code].....

View 0 Replies

ActionScript 3.0 :: Calling A Function From Inside A MC

Aug 13, 2009

I am using tweenlite throughout my file. I am importing it on the root timeline and would like use it inside a movie clip without having to reimport it. How do I reference it from inside the movie clip? I thought I could do something like this, but it does not seem to work: parent.TweenLite.to(leaf1, 1, {alpha:0, delay:1});

View 15 Replies

ActionScript 3.0 :: Calling A Function Inside Of A Mc?

Aug 7, 2009

theres a function on the main timeline, I want to call it from inside of a movieclip.the first error was that it couldn't find the function and then I found a post where a guy said I should try something like MovieClip(root).fn() which made sense but then I got the "cannot convert stage to movieclip" error.

View 1 Replies

ActionScript 3.0 :: Calling An MC On Root Timeline From Inside Another MC?

Apr 12, 2010

how can I call an MC on root timeline from a button inside another MC?

View 1 Replies

ActionScript 3.0 :: Calling A Function Inside Another Class?

Sep 9, 2009

I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?

package
{
import flash.display.MovieClip;

[code]......

View 12 Replies

ActionScript 3.0 :: Calling A Function Outside A Movieclip From Inside One

Sep 16, 2007

I have a function I made in the root timeline. Inside of a movie clip, I have a button which calls the function in the actions layer in the root timelime.. how do I make this work?

[Code]...

View 5 Replies

ActionScript 2.0 :: Calling A Function Inside Of A Loaded SWF?

Aug 27, 2009

I'm using loadMovie to load in an external SWF file. I'm looking to call a function called setText() inside of this swf. I can get to the function by doing this:

ActionScript Code:
toolTip = _root.createEmptyMovieClip("toolTip", _root.getNextHighestDepth());
toolTip.loadMovie("ToolTip.swf");

[code]....

but it's not working like this:

ActionScript Code:
toolTip = _root.createEmptyMovieClip("toolTip", _root.getNextHighestDepth());
toolTip.loadMovie("ToolTip.swf");
toolTip.setText(aTxt);

how I can do this without an enterframe?

View 3 Replies

ActionScript 3.0 :: Calling Javascript Function From SWF Inside Another SWF

Apr 30, 2010

I have a SWF that is used to load other swf to it.

each of the loaded swf files has its own button events that try to access javascript functions. The problem is that they can't access the javascript. It never gets to call the functions.

If i run those swf on their own then it works..

what should i do do have embedded swfs to call javascript methods ?

View 1 Replies

ActionScript 2.0 :: Calling External Javascript Inside Flash

Sep 4, 2010

I'm not that good with flash and even worst with javascript.I'm trying to create a flash site for a radio station that will show information from the facebook fan page.I search over the whole Internet and found little or no info on how to do this. This is the code that I want to add to my flash site.[code]

View 3 Replies

ActionScript 3.0 :: Calling A Variable From Inside A Movieclip In Flash CS4?

Nov 14, 2011

I am trying to trace a variable string from inside a movieclip which is inside another movieclip on the main timeline using:

[Code]...

View 6 Replies

ActionScript :: Flex - Calling MXML Inside The Class?

Jul 27, 2009

How can i call MXML components inside my ActionScript Class.

// filename.mxml
<mx:Canvas x="181" y="180" width="333">
<mx:Button styleName="LoginButton" id="loginButton" click="checkLogin();" x="160" y="261"/>
<mx:TextInput styleName="loginTextInput" id="username" x="160" y="161"/>

[code]....

I need to access the username and password fields of MXML in my ActionScript Class.

View 3 Replies

ActionScript 3.0 :: Calling A Button Inside Movie Clip?

Feb 10, 2010

My problem is I don't know how to call buttons that are located inside the movieclip?

nav_btns is the movie clip on the main tiimeline, contact_btn is the button inside the mc

script example: nav_btns.contact_btn.addEventListener(MouseEvent.C LICK, btnClick);

everything is labeled correct and i still get a undefined error

but i figured it out "use the Target" in AS3

View 7 Replies

ActionScript 2.0 :: Calling A Function Inside A Flash Movie Via JS?

Aug 7, 2007

I need to call a function inside a Flash Movie via JS (to update a textfield and sum Vars) can someone point me in the right direction???I tried to figure out the external interface api, but i dont understand how it really works ... For example: JS calls function "Fieldupdate" and in the Flash Movie the Fields and Vars Updates

View 2 Replies

ActionScript 2.0 :: Calling Functions Inside Custom Class?

Aug 17, 2007

what I want to do is let a lister triggered function create a new timer, but somehow it doesn�t work.

Code:

class classesUI.GamePage extends MovieClip
{
private var timeKeeper:TimerExtended;//Special class
private var roundTimes:Number;

[code]...

View 1 Replies







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