Flash :: Possible To Have Different Line Scalemode Options For Parent And Child Display Objects?

Sep 1, 2011

Imagine situation when child component is scaled and parent component is scaled as well. I want line to be drawn without scaling in child component and to be scaled in parent. Is it possible to achieve this?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Display Objects Parent Child Relationship?

Sep 22, 2009

Confused over actionscript children. Reading a book on this shows the following code:

var firstContainer:Sprite = new Sprite();
var secondContainer:Sprite = new Sprite();
secondContainer.addChild(firstContainer);

[code]......

View 6 Replies

Flex :: Null Cast Between Parent And Child Objects?

Mar 1, 2011

I have a flex application with two objects: a parent widget (called an IBaseWidget) and a child widget (called a HelperWidget2).When the user clicks on a help link, a helper widget is loaded into the list of base widgets and then displayed for the user.However, when I try to access this child widget by casting the base widget in the collection to the child widget type,the child widget returns null and I am unable to work with the widget.The following snippet correctly returns the widget ID of the newly added widget and dispatches an event to load the widget:

var id:Number = WidgetManager.getInstance().getWidgetId("Helper");
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, id, openQuickQueryCanvas));[code].........

The problem is that helperWidget above always returns null, meaning the cast isn't successful.

View 1 Replies

ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width / Height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.[code]Sprite2 is a rectangle. When I rotate it, of course, the height of its parent, SpriteP, GROWS. But I would expect that height to go back to what it should be when I'm removing Sprite2!And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200.

View 10 Replies

ActionScript 3.0 :: Child-parent Relationship \ Adding Them All As Children Of The Stage And Creating A Parent-child Hierarchy Between Them?

Jun 6, 2011

i am slightly confused about the parent and child relationship. lets assume we have several different instances, what would be difference of adding them all as children of the stage and creating a parent-child hierarchy between them(other than the access path).

View 5 Replies

ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width/height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.

When Sprite2 is NOT rotated:

Code:
trace(SpriteP.width + ' ' + SpriteP.height); //100 250.
SpriteP.removeChild(Sprite2)
trace(SpriteP.width + ' ' + SpriteP.height); //100 200. -> works, 200 is good.
When Sprite2 is rotated at 90:

[Code].....

And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200. But if I rotate Sprite2, the Parent won't update its bounds.

View 1 Replies

Flash :: Flex4 / AIR With NativeProcess - Cannot Pass Cmd Line Options To Imagemagick Convert.exe

Mar 22, 2011

I'm trying to use Imagemagick convert.exe with Flex4 NativeProcess. I know I have it configured properly because I can get a successful result with a simple call with no options to convert.

[Code]....

View 1 Replies

ActionScript 3.0 :: Positioning Parent MC In Order To Center Child MC On Parent's Parent MC

Feb 5, 2010

[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]

View 2 Replies

Actionscript 3 :: Flash - Child Within Parent Within Parent?

Aug 24, 2010

I am trying to make a calculator where a user can select from a list of items. If a user clicks say "ITEM1", it should add the item to a "CONTAINER_MC". The problem i have is all my data is set inside an array containing names and prices like the code below.

[Code]...

View 1 Replies

Flash - Drag Child Mc Out Of Parent Mc And Add To New Parent Mc?

Oct 6, 2010

Here is a working script to drag drop a ball from the stage into another target mc:

ball.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void{ [code]...

It works well but I'm new to AS3 and I am having difficulty amending this script to drag the ball out of a parent mc (instead of the stage) and onto another mc (the target mc). To explain: imagine a ball, a box, a tri, + more shapes all within a scrolling mc (initial parent), the user scrolls to select a shape, then drag-drops onto a target mc on the stage.The scrolling is no problem, but how would you amend the script above so that the ball can start inside a parent mc rather than on the stage itself?

View 2 Replies

ActionScript 3.0 :: Unable To Reference Child Display Objects Of Clip Imported From Library?

Jun 17, 2009

PBar contains two SimpleButtons (pBarProgress and pBarLoaded) and a MovieClip (pBarBg).I import pBar from the library like this:private var pBar:PBar = new PBar();and add it to a container MC on the stage like this:containerMC.addChild(pBar);Up to this point, everything works great. I can see pBar and its children on the stage when I run my movie. But then I want to start referencing and manipulating pBar's child objects, but nothing I do works. Ive tried ...pBar.pBarProgress.scaleX = 0;var pBarProgress:SimpleButton = Bar.getChildByName("pBarProgress") as SimpleButton; pBarProgress.scaleX

View 1 Replies

ActionScript 3.0 :: Remove Parent.parent.parent Child?

Jan 3, 2010

I got a "preloader" that creates an movieclip and loads an SWF. Now in the loaded SWF i want a close button to go back to the "preloader". The preloader isn't an actuall preloader but some sort of mainclip.Now i tried this:removeChild(MovieClip(e.currentTarget).parent.pare nt.parent)But i get error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild()at MethodInfo-6()

View 1 Replies

ActionScript 3.0 :: TypeError: Error #2007: Parameter Child Must Be Non-null. At Flash.display::Display

Feb 5, 2011

I have tried to fix this error but I just cant get it to work.

View 2 Replies

ActionScript 3.0 :: Add A Clip To The Stage As A Child And Remove The Parent And Set The Parent Equal To Null?

Sep 11, 2010

if I add a clip to the stage as a child and remove the parent and set the parent equal to null, does the child get collected and removed from memory? What if the child has an image loaded into it as its child? 

In my application I'm loading a series of png images as overlays that can be tinted for customizing in this app. When I trace my memory, the basic app idles at 64,000 k. The exact second I load those overlay images it goes up to 205,000k. If I remove those clips and "clear" the stage I should go back down to 64,000 k if everything is removed and collected correctly, right? It's not, it's hanging at 215,000 k. Are my images being cached and that is the reason for the memory staying up? If so, how do I prevent that. Or upon removing the parent of the image how can I un-cache the image.

If a user switches between models and loads several different items then the application actually crashes the Flash environment because of too much memory usage. It also does the same to browsers.

View 29 Replies

ActionScript 3.0 :: Tab Indexing Loop Through Parent, External Child Swf, Back To Parent?

Nov 11, 2009

I have a parent swf which loads many child swfs (though only one is displayed at a time). My intention was to use the loaded SWFs document class to retrieve an array of objects to be assigned a tab index, combine this with the parent's own array of objects and apply sequential tab indices to them all. But what happens is actually that the parent's objects are assigned an index, but the external swf is unaffected. In fact, the external swf retains its automatic tab indexing, when I would expect that having set a value for InteractiveObject.tabIndex, automatic tab indexing would be disabled.

I've seen similar tales elsewhere. Most posts I've read are wanting to load an external swf, give it focus and loop through those objects, then close the swf and return to looping through the parent. However I would like loop through all objects as one. including manipulating the focus manager(s), and basically fiddling with every tab-related property I know.

View 2 Replies

ActionScript 3.0 :: SetChildIndex And SwapChildren - On Mouse Over Set The Parent Of The Moused Over Text Field To The Highest Depth Child Of Its Parent

Sep 29, 2011

trying to on mouse over set the parent of the moused over text field to the highest depth child of its parent i tried both of these: [code] private function

[Code]...

View 3 Replies

ActionScript 1/2 :: Write A Line That Has 3 Options, Then Randomly Choose Between The 3

Dec 10, 2009

I am trying to randomly rotate an object in flash, I have done this previously via:

this._rotation = random ( 360 );
 
But now I would like to specific 3 rotation angles, that it is able to randomly choose between instead of 0 to 360.

Eg. I might have 0, 120, 240 as the 3 options I'd like it to randomly choose between.

View 9 Replies

Actionscript 3 :: Assign A Parent's Variable From The Parent's Child?

Nov 7, 2011

i want to pass the variable from parent to child .How Can i pass the Variable.Here i paste my code.

My Parent Class

public class PlayerStrobe_domaincheck extends Sprite
{
private var myService:NetConnection = new NetConnection();
private var _loader:Loader;

[Code]....

View 3 Replies

ActionScript 3.0 :: Loading Subclassed Display Objects With Flash.display.Loader?

Oct 8, 2009

When using Loader class to load display objects (bitmaps, SWFs...) from remote URLs, is there any way for them to be instantiated (referenced as we know, by Loader::content property) as some user specified valid subclass? For example if I had a class that extended a Bitmap, is there any way for the loaded object to be of this class?

View 9 Replies

Flash :: Display Objects Which Are Outside The Display Area When Is Embeded In HTML?

Nov 22, 2010

Is there any way to display flash objects which are outside the display area when flash is embeded in HTML
The reason i ask is my current project has a rotating + enlarging effect which is largely dynamic so sometimes an object may clip the edge of the stage areathis looks messy but i dont want to increase the stage area to cover  the largest possible area any object could enter because most of the time the objects are at the center and small so i would end up with a lot of white space

View 8 Replies

Flash - Sorting Display Objects By Their Display List Depth

Aug 5, 2011

I have a list containing display objects from throughout the application (insertion order). I want to process the list either top-down (parent, child) or bottom up (child, parent). The only requirement is that either a parent is processed before any child or vice versa a child before its parent. What is a good approach? This question is not about sorting a list. It's about retrieving the depth of a particular display object.

Example
Display list:
A (root)
B1
C1
C2
D1
B2
......

My list:
list = [E1, F4, A, B2, B1, C3, ..., N9, N8]

Bottom-up:
N9, N8, F4, E1, C3, B2, B1, A

Top-down:
A, B2, B1, C3, E1, F4, N9, N8
Does not matter if N9 before N8 or N8 before N9. Important is that any N is before M (first run) or any M before its children N* (second run).

View 2 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

Flash :: AS2 Parent - Child Swf Communication

Feb 29, 2012

How do I do this? Inside the parent swf myVar value is set by query string value loaded in by swfobject var myVar = _level0.part; // i have the value 123 here ..all good so far

[Code]...

Always childLog.text is undefined :( - so how to access the value of myvar from the child?

View 1 Replies

ActionScript 3.0 :: Flash - Should A Child Know Its Parent

Oct 30, 2010

I am working on a component framework for myself right now, and was wondering if a child component should contain a reference to its parent. Obviously flash itself does this as part of the movieclip parent/child structure, so I figure it's okay to do this, but does this present any memory problems or anything, having references to the parent in the child? Would it be better to do some sort of lookup tree, just passing each child an array of GUIDs or similar which I could use to trace a component back to all its parents?

View 14 Replies

Flash :: Share Classes Between Parent And Child SWF?

Aug 13, 2011

So i have a situation where i want to pass a object of a class say 'MyBigAwesomeClass' from a child to a parent. I import the class definition into both the parent and child. Now, if i load the child swf from a location that is relative to the location of the parent , all is fine, however the moment i load it using a full absolute path, it treats the definitions for 'BigAwesomeClass' in parent and in child as different and does not allow an object of the type 'BigAwesomeClass' to be assigned to an object of the same in the parent class.I am totally stumped, and have banged my head over ApplicationDomains, including using this code

loader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfLoaded);
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader.load(new URLRequest(_file.url),context);

[code].....

View 4 Replies

AS3 :: Flash - Passing Variables From Parent To Child?

Oct 14, 2011

I'm trying to access some variables from my parent in my child MC.

Parent code:

var data_history:String;
function finish_checkUp(event:Event):void{
var checkUp_stat:String;

[Code]....

Now as you can see, i have tried the trace method, but with no luck. Flash doesn't report any errors regarding the trace method, but does report the two undefined vars (data_history). Ive tried to use the trace method above all the functions, at the top of the script, still the same errors though.

View 2 Replies

Flash - AS3 Font Embedding From Parent To Child SWF

Jan 10, 2012

I have a parent swf with fonts embedded in the library, which have export for actionscript set and a class name assigned. The patent swf loads a number of child swfs to which I'm trying to pass a textformat object using a desired font from the parents library. How can this be achieved. I have tried Font.registerFont(font class) and created a new instance of the font before setting the textformat, but this only works on machines with the font installed. In the child swf, the textfield text is set, then the textfomat applied with setTextFormat();

View 2 Replies

Flash :: Animate A Child Independent Of Parent?

Feb 9, 2012

We are creating a system where elements in a display unit are defined through xml. This also means that the whole system is dynamic in nature. [code]...

View 2 Replies

ActionScript 3.0 :: Flash Calling Parent From Child

Jul 21, 2011

In my child constructor I use MovieClip(this.parent).blablabla() to retrieve info, yea I know I can pass it through the constructor, anyways I keep getting errors anytime I try to use MovieClip(this.parent) in the constructor, it gives a refrence error saying it's null.

Why doesn't that command work, is there a way around it (other than the constructor)? Is it because it's bad design? I'm calling a function that has alot of data, so I'm just passing this to the child and using the passed this data to call the parent atm, looking for a better MovieClip(this.parent) solution.

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







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