ActionScript 3.0 :: Get Stage Size Of Parent Swf?

Aug 14, 2011

I have a loadedSwf that i loaded into my mainSwf. I'm trying to do some aligning with some objects in my loadedSwf file, but they're only referencing the stage of the loadedSwf so the alignment is off. Is there a way to refer to the stage of the mainSwf? I tried using parent that didn't seem to work. All the searches i found were aligning to the loadedSwf which isn't quite what i want.

View 7 Replies


Similar Posts:


ActionScript 3.0 :: Referencing Stage - Add Bullets To The Stage Rather Than Using Parent.parent.parent.addChild?

Jul 10, 2009

I'm currently making a platform game and when the player shoots i want to add the bullets to the stage. The players gun class is in charge of adding bullets. The "players gun" is a child of "players gun holder" which is a child of "player" which is a child of the stage. is there a better or more dynamic way for the "players gun" to add bullets to the stage rather than using parent.parent.parent.addChild (bullet);

View 2 Replies

ActionScript 3.0 :: Get An Object To Increase In Size The Lower It Goes Down The Stage And Decrease In Size The High It Moves Up The Stage?

Dec 29, 2009

I'm trying to get an object to increase in size the lower it goes down the stage, and decrease in size the high it moves up the stage.

It only needs to increase or decrease by a small amount. Basically, it's for a game character. To ad realism to his movements, it would be nice to have this feature.

This is where i'm up to so far:

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

[code]....

I think I need something like:

if (object moves up)
decrease
else if (object moves down)
increase

View 6 Replies

ActionScript 3.0 :: Changing Component's Size Doesnt Update Parent's Size?

Mar 1, 2010

I have following problem:

Code:
title_txt = new TextInput( );
title_txt.setSize( 100, 20 );

[code]....

View 4 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 :: 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 2.0 :: Changing Stage Size To Match Photo Size?

Mar 30, 2010

I'm working on a slideshow where I'm calling in photos from an xml file. How do I tell AS to resize the stage according to photo dimensions? Would I need to list the dimensions in the xml file? If so, how would I pull that into the fla file with AS?

View 6 Replies

ActionScript 3.0 :: Stage Size = Window Size?

Jun 28, 2009

is possible to dynamically change the dimensions of my flash stage depending on the size of the browser window ?

Very important, I don't want to stretch any element. Just make the background bigger.

View 6 Replies

ActionScript 3.0 :: Stage Size And Window Size

Jun 28, 2009

is possible to dynamically change the dimensions of my flash stage depending on the size of the browser window ?

Very important, I don't want to stretch any element. Just make the background bigger.

View 10 Replies

ActionScript 3.0 :: Load The .swf With The Exact Stage Size So The Graphic Elements Do Not Float Outside The Loaded Movies Stage Area?

Sep 7, 2010

I'm making a mockup for a client and I need to Load the .swf with the exact stage size so the graphic elements do not float outside the loaded movies stage area. [URL]Basic load code I'm using...

Actionscript Code:
import flash.display.*;var adLoader1:Loader = new Loader();adLoader1.load(new URLRequest("100828_budlight_texas_fight_728x90_jn.swf"));adLoader1.x = 313;adLoader1.y = 162;addChild(adLoader1);var adLoader3:Loader = new Loader();adLoader3.load(new URLRequest("100828_budlight_texas_fight_300x615_jn.swf"));adLoader3.x = 738;adLoader3.y = 0;addChild(adLoader3);

View 3 Replies

ActionScript 2.0 :: MC - Prototype - PhotoAlbum - Cannot Encapsulate The MC That Loads The Full Size Image Into A Parent Clip

Mar 12, 2004

(I'm working in flash 6 due to some constraints but if what I'm doing could REALLY be optimized by going to 7 then feel free to yell at me - OH, and feel free to yell at me because there is a bunch of pink - I haven't worked on the actual layout because I'm waiting for the colors-font-realImages) I will save space here and just post the link to the dir, swf, and fla...

[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

Flash :: Get Coordinates In Parent But Not In Stage?

May 12, 2010

I know about Flash's localToGlobal and globalToLocal methods to transform coordinates from the local system to the global system, but is there a way to achieve the intermediate? To transform coordinates from an arbitrary system to any other arbitrary system?

I have a clickable object inside a Sprite, and the Sprite is a child of the stage. I want to retrieve the clicked point in the Sprite.

View 2 Replies

ActionScript 2.0 :: How To Get Parent Stage.width

Feb 13, 2010

i have a swf (child swf) which is loaded into another swf (parent swf). I want the child swf to know the stage.width of the parent swf. If I trace "_parent.stage.width." I get output undefined. Is there a way to do this?

View 3 Replies

Actionscript 3.0 :: Can't Seem To Get Variables To Get Parent Stage

Jun 17, 2009

I have a loaded SWF into a simple "holder" empty movieclip I have on the root stage. Inside that SWF I have two variables that have "stage.stage Height" and "stage.stageWidth" in them. If I leave them on the code and test the root movie I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.So basically I can't seem to get the variables to get the parent stage. Anyway to get around that?

View 2 Replies

ActionScript 3.0 :: Child.x == Stage.x Instead Of Parent.x?

Aug 8, 2009

is it possible to get the x of a child equal to the stage.x instead of its parent.x?

View 2 Replies

ActionScript 3.0 :: Use Stage SubClass As Root / Parent

Dec 19, 2010

Is there a way to tell flash to instantiate a Stage subclass called "TheStage" instead of the default Stage class as root/parent of my document class?
public class TheStage extends Stage{
//code
}

Then when I do "DisplayObject.stage" I want it to return the instance of TheStage instead of the default Stage insteance. I want to do this so that I can override the addEventListener method of the Stage class. So if I call DisplayObject.stage.addEventListener I can execute my own code routine. Is that possible and how?

View 8 Replies

ActionScript 3 :: Get All Children On Stage / Parent Object

Feb 1, 2011

How do I get a list of all the children (Sprites) on the stage of my Document Class OR how can I get a list (length) of all the children (Sprites) of a parent (Sprite)?

View 1 Replies

ActionScript 3.0 :: Override MovieClip's Parent And Stage Properties?

Jul 10, 2009

is there a way to override a MovieClip's parent and stage properties? In a custom class extending the MovieClip class we can override the get parent() and get stage() methods. But is there a way to do it to existing MovieClip?

I mean I have an external swf content (loaded) and assigned to a movieClip. But now, how can I assign the loaded MovieClip to my custom class, so that it "doesn't see" the parent and stage properties?

Or can I override functions of existing classes? Sth like:

override public function myMovieClip["get parent"]():DisplayObjectContainer
{
...
}

I just need to prevent a loaded MovieClip from having access to the main movie's stage.

View 3 Replies

ActionScript 3.0 :: Destroy An Timer On Its Parent Removal From Stage?

Nov 12, 2009

I'm having an issue where I am placing a timer inside of a MovieClip instance which is dynamically placed on stage. When I remove the MovieClip from the stage, the timer keeps on running. It is sometimes a bit complicated to be able to stop all the timers inside of this MovieClip so I was wondering if there was a way to either destroy the MovieClip instance and thus destroy the timers within it? or how could I go about making sure the timers stop when their parent Object is not on stage.

View 2 Replies

ActionScript 3.0 :: Loaded Swf Can Not Recognize Stage Of Parent Correctly

Feb 24, 2010

I am executing the lightbox functionality from a swf file that is loaded by a parent swf.  For testing purposes, when the lightbox button is clicked, the image should fill the entire stage.  Even though both the loaded swf and the parent swf recognize the same stage dimensions at all times(validated through tracing statements) and the lightbox image is positioned to the top/left corner of the stage, the image instead aligns to the top/left corner of the loaded swf.  And if the stage is resized after the lightbox image is displayed, the container MC (which is located in the parent swf and centers all the sites content) re-aligns to the top/left corner of the stage .[code]...

View 1 Replies

Professional :: Tweening Parent To Put Child Over Stage Center

Jul 22, 2010

I've been working on an interactive map of the counties in Montana.  When a user clicks on a county, I'd like the map to zoom to the county's extent and center it on the stage.  Every county is a child of a larger container (the state, names allcnt_mc).  I've set things up in my function so that when you click on a county POINT variables with all the numbers you need are created.  I just cannot get the desired effect and I think I am missing something basic in regards to the geometry of my stage.  Can anyone see something I am missing?  I set this up so that the parent is tweened to a new location equal to stage center minus the called child's x,y distance from stage center.  Essentially, this should center the child over the stage center, no?
 
function tweenparent(e:MouseEvent):void{
//create vars for x,y cordinates of clicked county (child)
var calledx:Number=allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].x;

[Code]....

View 9 Replies

Flash - Parent MovieClip / Stage Not Found Even If It Is Present

Dec 1, 2011

Why do I get this error saying parent does not exist when I try to remove a movieclip. In the first case, the movieclip cannot exist either on screen/memory if it was not 'contained' by either a movieclip or stage. How can this happen, can somebody explain how this "movieclip" loses its parent reference to the stage or container mc. The debugger stack shows the value of movieclip.parent as null.

View 2 Replies

Flash :: Find The Parent Of A Deep-nested Sprite From The Stage?

Jan 21, 2011

I'll give a complete explanation of what I'm trying to do. I have a video player as a separate SWF. In this video player I have a VideoContainer class extending Sprite, which contains the video and a control bar with specific video buttons.

This SWF is loaded in another main SWF, which has a menu that is on top of everything else. When I click "Fullscreen" in the video SWF, everything goes smoothly, except the menu remains on top of the VideoContainer object.

I need a way to change the display order of the loaded SWF, to put it on top of everything else on Fullscreen and change it back when Fullscreen goes off. All this needs to be made inside the video player. Also, the configuration of the children can change (the video player can be loaded in different places in the main SWF), so I can't use a certain unchanging path.

View 2 Replies

ActionScript 3.0 :: Prevent A Child Swf From Referencing Its Parent Swf Stage Width/height?

Oct 11, 2010

I would like to know the way to prevent a child swf from referencing its parent swf stage width/height?

for example, i created a child swf that loads image and center it on it's stage. As a stand alone its fine but i loaded it with parent swf, it centers on the parent swf instead.

View 3 Replies

ActionScript 3.0 :: Load Swf From A Child MovieClip Button Into A Holder On Parent Stage

Apr 10, 2011

I am trying to load a swf into a holder movie clip from the child movieclip.It's parent has a holder that i want to load a swf into.I am navigating from within a child clip.It would be nice to have the swfs load from an external xml file but it isn't mandatory.

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

Professional :: Set The Size Of The Stage To 500 X 400?

Jan 26, 2011

I have created a flash project in CS5 and I have set the size of the stage to 500 x 400. When I view it in the flash player as the swf it plays fine. What I want to be able to do is get the swf file to fill the screen with the image no matter what size the end user scales the window of the Flash player too.

View 5 Replies

ActionScript 2.0 :: Var And Stage Size?

Jul 6, 2009

i have a bit of a problem with a number var. On opening stage (875 px) the var value is 368; when i resize the stage i need the var to grow till 578 max.

View 1 Replies

ActionScript 3.0 :: Scope To Access The Stage Property With Root Or Parent - Error 1119

Mar 7, 2009

I have a MainClass from where I can call Stage. In the MainClass I call another class named Subclass, and in that one I call my ThirdClass. ThirdClass is initialized fine, but my problem appears when I want to call the Stage within the ThirdClass, to align the Stage. When I compile I receive the message: 1119: Access of possibly undefined property align through a reference with static type Class.

[Code]...

View 4 Replies







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