ActionScript 3.0 :: Get The Child Of Canvas?

Aug 26, 2009

I have a Canvas(oldcanvas) whose child is a Panel [and is the only child].

Now i want to drag and drop that panel on to someother canvas(newcanvas).

But by using newcanvas.addChild(oldcanvas.getChild(0)) is not working.

I am able to add the complete oldcanvas to the newcanvas but not able to get the child i.e the panel inside that.

View 1 Replies


Similar Posts:


Actionscript 3 :: Way To Tell Canvas To Dispatch Event Only If Not Over Child?

Oct 2, 2011

I got a square component inside a canvas which when clicked shows a glow effect-indicating selection-while clicking somewhere else this effect is removed-indicating deselection.The problem is that the canvas always dispatches the "deselect" event, even if the mouse if over the square.I worked around this by defining a circumstantial function which removes the child's width,height from the parent's "clickable" area.Is there a better way to tell the canvas to dispatch his event only if not over the child ?

View 1 Replies

Flash :: Resizing A Child Canvas In Flex?

Jan 18, 2012

I'm trying to figure out how to resize a child canvas but I can't quite figure it out. I have a bunch of mini canvas' around a parent canvas like this:

<mx:Canvas width="10" height="10" backgroundColor="#040404" top="0" left="0" id="anchorTL" />
<mx:Canvas width="10" height="10" backgroundColor="#040404" right="0" top="0" id="anchorTR"

[code]......

View 1 Replies

ActionScript 3.0 :: Recognizing The Child Elements Of A Canvas?

May 14, 2010

I am trying to develeop a Graph Structure with drag and drop features in Flex. I have to connect various components/children on the canvas. Once i drag n drop the components on the canvas, i am using SystemManager event handlers to draw connectors between the components. But, as i click on one component and drag the mouse, the line is drawn on the canvas as long as my mouse stays only on the canvas. If the mouse moves over a component/child(that has been dragged and dropped onto the canvas), the line is drawn to the origin of the canvas from the first clicked component. How shud i recognize the component when i move my mouse over the component? I want the line to be drawn connecting the components once my mouseup event is called.

View 3 Replies

Flex :: Random - Canvas Child Randomly Resizes

Mar 25, 2010

I have an application with a viewstack that contains all the components that need to be displayed. The navigation is defined in the main application. All the components are based on canvas. The main application looks like that:

[Code]....

View 1 Replies

Flex :: Get Individual CreationPolicy On Canvas Child Of A TabNavigator?

Oct 19, 2010

Having read about Container creationPolicy (thanks all the references in StackOverflow)I have a TabNavigator and AS code in the initial Tab needs to reference components of second tab (a Canvas with multiple children).But the components of the second tab are null until that Tab is rendered.

According to the documentation as I read it, I should be able to set creationPolicy on the second tab/Canvas to "all"; the TabNavigator will instantiate all its top-level children, even with its multi-view creationPolicy="auto"; and I was hoping that when creating the child Tab/Canvas, that the creationPolicy="all" of that single-view Container would be honored.

But it appears that this is not the case; if the TabNavigator has creationPolicy="all" then the second Tab is populated (but so are the third, fourth, ...); but with "auto" the second Tab is created, but not populated, even though its creationPolicy="all".Is there a way to get just selected Tabs to pre-instantiate?

View 1 Replies

Actionscript :: Dynamically Adding Child Components To Canvas Vs Group In Flex?

Aug 4, 2011

I've a custom component where I do some graphics (e.g draw a line) and dynamically add a subcomponent (e.g a label) to it.

If I base the component off Group (which is recommended as per docs since its a spark component) then when I dynamically add a label the graphics part disappears.

However if I base it off Canvas this doesn't happen.

Why is that the case?

Here is the code.

MyComponent.as
public class MyComponent extends Group
{
public var x1:int;

[Code].....

View 2 Replies

Flex :: Add Child On Canvas And Set It "on-top" When Clicking Mouse?

Nov 21, 2010

I need to add an UIComponent (Label for example) as a child on a canvas and I need to set it on-top (when user click on the label with the mouse, the target event will be the label and not the canvas)I'm sure flash has a solution for that but I can't find it on the net.

View 1 Replies

Flex :: Dynamically Add Different Items To ThumbContent Canvas And Use Scroller Canvas To Scroll

Jun 5, 2009

I have the following code in my flex project.

[Code]...

I want to dynamically add different items to thumbContent canvas and use scroller canvas to scroll. I see than the height of thumbContent bigger than 7977 it truncate from scrolling. So - I see the scroller canvas with empty space on top. Then I scroll to bottom - I see the content of thumbContent and at bottom scrolling I see empty space too.

View 1 Replies

Flex :: Skin A Canvas With Image And Scale It To Size Of Canvas In It?

Apr 9, 2011

I'm trying to skin a canvas with an image (which is essentially a custom border for the canvas). I've been trying the backgroundImage style as well as the borderSkin style. I can't get the image to scale to the full size of the canvas though. I was wondering what the best way to go about this is.[code]...

View 2 Replies

ActionScript 3.0 :: "mouse Off Canvas" - Go To Frame2 When The Cursor Leaves The Canvas

Feb 24, 2011

Basically I want to go to frame2 when the cursor leaves the canvas. The code below contains no errors when tested but it still does not work.

[Code]...

We know that the function gotoAndStop(frame2); works in multiple situations which means the first 3 line is fine. I don't know if the problem is the MOUSE_LEAVE event or this.stage which i suppose is the identifier for the canvas. I sure that there must be an alternative code for the identifier this.stage or the whole code. Any solution on how to fire the given function in the event when the cursor leaves the canvas?

View 2 Replies

ActionScript 3.0 :: Multiple Buttons To Open Child Swfs Then Be Able To Close The Child From Within The Child?

Mar 25, 2009

I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage

View 2 Replies

Flex :: SWFLoader - Child Apps Couldn't Access Certain Objects That Were Instantiated By Another Child App?

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

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 :: Flash Selecting A Specific Child By Mouseclick, Turning Off A Child Within All Non Selected?

Mar 19, 2011

I've used this site as a resource leading up to this, not particularly sure if I worded this correctly I have a class "Block" which is just a square (will be something else later on in the process) I want each block to have controls to add an additional block in either direction so I have another class BlockButtons which has my buttons for each direction.

And another class GlobalVar where I keep all my variables for funsies

[Code]...

View 1 Replies

Flex :: ViewStack.addChild Adding Multiple Child And Only The Last Child Is Visible?

Mar 10, 2010

var viewStack:ViewStack = new ViewStack();
viewStack.percentWidth = 100;
viewStack.percentHeight = 100;

[Code]....

Its only displaying canVas3 contents not canVas1 and canVas2

View 1 Replies

Flex :: Viewstack - Navigate To The Second Child During Onclick Of A Button Present In The Second Child?

May 10, 2010

I have a component mxml file in which i have a view stack, on click of a button i navigate to the first child, now i need to navigate to the second child during onclick of a button present in the second child. All the childs are component files included within the view stack. How could this be done, Sample code is present below,

[code]...

Now in my offering.mxml file if i try to access navigationViewStack i am getting an error stating 'Access of undefined property navigationViewStack.

View 3 Replies

ActionScript 3.0 :: Access Child Vars/functions Without Adding Code To Child?

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

Actionscript 3 :: Remove A Child At A Point - Error #2025: The Supplied DisplayObject Must Be A Child Of The Caller

Dec 14, 2010

i'm new to AS3 and i was wondering what is the best way to remove a child at a point. i tried Holder.removeChild(Holder.getObjectsUnderPoint(new Point(exampleX, exampleY))[0]); however that returned ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

View 2 Replies

Child Of Child Movie Clip Are Null In Imported Object From Flex To Flash Right After Being Created?

Dec 16, 2010

I have an Movie Clip in Flash that have subobject of button type which has subobject of input text and movie clips. Right after creation core Moveclip all subobject are set to null, when I expect them to be valid objects.

[Code]...

MC_Core_design was created in Flash and exported to Actionscript. I've done this for button_1 class aswell. The code was written using Flex. When I comment out both lines that result in error I get correct view of the core Movie clip with all subobject. How can I set subobject properties right after object creation?

View 2 Replies

ActionScript 3.0 :: Parameter Child Must Be Non-null And DisplayObject Must Be A Child Of The Caller?

Jul 22, 2009

a quick low down would be its a gallery on the second frame and I breaks when coming back tot he first frame, all tweens die and such.

the errors are:

TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/removeChild()
at index_779_fla::MainTimeline/imageLoaded()

[code]....

View 1 Replies

ActionScript 3.0 :: DropTarget Parent Child - Removechild Won't Remove A Child

Aug 21, 2010

I have an issue where removechild won't infact remove a child. I think its something to do with my dropTarget.parent issues. The concept of the code is that you drag a source onto a destination. When you drop the source onto the destination you will get a text field that says "Hello" or "Goodbye". The objective i want to achive is that once i drop a source onto the destination, removechild will remove any previouse textfields added. This is proving difficult.

[Code].....

View 3 Replies

ActionScript 3.0 :: Removing Child (a Sprite) Containing (dynamic Textfield) Child?

May 12, 2010

I have created 2 sprites each containing a dynamic text field child. I then add this as a child of the stage. (I have done this in order to make the text clickable with a hand cursor on mouseover)It loads in fine, I just run into problems when trying to REMOVE it the sprite containing the text."ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller."Sections concerned in red:

Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;

[code]........

View 2 Replies

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 :: How Can A Loaded Child Swf 1 Communicate To Next Child Swf, Child Swf 2, Which Is Currently Not Loaded

Oct 14, 2011

I have a parent swf with three buttons: next button, back button, ticker on/off button.I have three child swfs, each with a ticker mc. When I click on ticker button on parent swfit dispatches a custom event which brings ticker MC on stage and thus ticker becomes visible (ticker off button displaces it out of stage by changing the value of ticker_mc.y).

the problem I am facing is when ticker is on and I click next or back button to load next or previous child swf, the ticker goes off. How can I make sure that ticker is on all the time and closes only when I close it. How can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded, that since the ticker is on on swf 1 so you please keep the ticker on on swf 2 as well?!

I think I know the problem. I have put a default value of ticker_mc = 160 (makes ticker inactive) on every child swf. So, the ticker becomes inactive everytime I load a new child swf. If someone could guide how can I do this, my problem will be solved: When first child swf is loaded, the default value of ticker_mc.y should be 160. I want to hold this value in a variable. When I click ticker active btn, position of ticker_mc changes to 194 so the value of variable should change to 194. When I click next btn, the variable value (160 or 194) should be sent to next child swf and ticker_mc.y should be equal to variable value.

This is the code so far

"Next button"
go_mc.next_btn.addEventListener(MouseEvent.CLICK, playNext);
function playNext(e:MouseEvent):void {
if (swf_no < (clips.length-1)) {

[code]....

View 1 Replies

ActionScript 3.0 :: Accessing A Child Inside A Child Inside A Child?

Nov 23, 2011

mHook -> mBottom -> hItemButton -> itemButton[a] -> itemButtonExp[a]

so i press another butoon, and retrieve a number 2, how do i access itemButton[2].itemButtonExp[2]? Coz i need to change the text field in there?

in AS2 i can access it directly by changing itemButtonExp[a].text, but how do i do it in AS3?

View 3 Replies

ActionScript 3.0 :: Passing Commands From Child To Child?

Aug 19, 2009

I have a main movie (main.swf). I load child1.swf and child2.swf into it with URLLoader. Is there any way to make a button to child1.swf which would take a user to some frame in timeline of child2.swf?
 
Something like
parent.child2.goToFrame(5);
 
I have tried different combinations without luck...

View 8 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 :: Calling Function From Child To Child?

Dec 9, 2010

I have a main.swf. I have loaded two child-SWFs into it, child1.swf and child2.swf.... There´s a videoclip inside child1.swf, can I stop that video from child2.swf?

View 2 Replies

Actionscript 3 :: Addchild Within Child And Clear The First Child?

May 25, 2010

Within the main timeline I have a menu, which is a MovieClip. This menu is comprised of about 17 "buttons", each of which point to a different section of the site. When a "button" is clicked (2 examples: menu_bag_button, menu_trashbag_button), the menu will animate, moving left, and 2 library items (bag_container and close_btn) should appear to the right, both within "framecontainer".Then, while the menu is on the left, this specific button must not repeat the menu animation, thus I did an if statement finding which frame it is on, and if it's on the left, it simply clears the framecontainer and loads the content again.

The problem is that when another link is clicked, it needs to do one of two things: if the menu is in the center with no content loaded, it needs to animate the menu to the right, and load the content/close_btn into "framecontainer"; or, if the menu is on the left, it needs to clear "framecontainer" and load the corresponding content.I've tried a lot of things but since all of these buttons are within "menu_mc", the actionscript has to point to the root, THEN to"framecontainer" and everything gets convoluted.Here is my current code. It functions fine, except for the fact that it doesn't clear content, so it continues loading the frames so that one is closed, there is still other content behind it:

import flash.display.*;
import fl.transitions.*;
import flash.events.MouseEvent;[code].............

View 1 Replies







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