Flex :: Accessing Root Of Loaded Swf?
Mar 4, 2012
I have a SWf application built in flex 4. One part of the application relies on accessing a public variable ("step1") set at the application root, and is accessed with
var app:Object = FlexGlobals.topLevelApplication;
trace("step one is "+app.step1);
This, while not optimal, has worked fine. Now, hoever, I need to load this entire application into another application, and I can't figure out how to access my step1 variable any longer.I have been loading the swf into the new parent application like so:
public var myLoader:Loader = new Loader();
public var pizzaContainer:UIComponent = new UIComponent();
private var myUrl:URLRequest = new URLRequest("chickensoup.swf");
[code]......
View 1 Replies
Similar Posts:
Jan 9, 2010
I'm having trouble accessing the value of the root node of an XML variable in flex. For example:
[Code]....
I can change the "Type" attribute above with X.@Type="xyz"; But how do I change "Content123" to something else? If the xml document were longer/deeper, I could say something like X.Entry[11].Cost=2.22; But what do I say in this case? Obviously X="Content456" doesn't work...
View 4 Replies
Mar 22, 2010
I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?
View 1 Replies
Apr 23, 2011
Using Flex 4, I have created an SWF that has the following code:
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import com.Index ;
protected function start(event:FlexEvent):void
[Code]...
View 1 Replies
Apr 16, 2009
here's my problem/code:
I have a mc in the main timeline named contactBox_mc, within this mc I have another mc named closeBtn_mc. I have added an EventListener to closeBtn_mc to set the visibility of contactBox_mc to false on MouseEvent.Click.. but no matter what method I try, I get the following error:
1180: Call to a possibly undefined method contactBox_mc.
This is the code I placed within closeBtn_mc to set the visibility of its parent movie to false:
closeBtn_mc.addEventListener(MouseEvent.CLICK, closeBox);
function closeBox(e:MouseEvent):void{
contactBox_mc(this.parent).visible = false;
}
I also tried: root.contactBox_mc.visible = false; and got the same error,
View 4 Replies
Sep 22, 2009
How can i access a function that is in a movieclip from the root?
i've tried these :
mcName.functionName();
MoviClip(mcName).functionName();
but all of them didn't work at all.
View 1 Replies
Mar 15, 2010
enter code hereI am loading an external swf into an component. It loads everything fine and I can see buttons working in the swf, I can add a movieclip to the but I can't then access that movieclip (or don't know how), and it keeps telling me numChildren = null when I try to trace it out. This is set up as a custom component like this:
<cynergy:imageZoom
id="zoomComponent"
borderStyle="solid"
source="{_data.map.@url}"
[code]....
how I would access the children in the loaded movieclip?I have tried
mycomponent.image.getChildAt(2) and it returns and error that the index is out of bounds.
View 1 Replies
Aug 2, 2011
I am developing a flex application with flex 4.1 sdk and java backend (runs on Glassfish 3.1 via http). For security reasons I decided to move my authentication process to https until a session id is obtained. Therefore I changed the filter settings to use ssl for login and logout pages(just two pages due to performance reasons. The data-size sent to client is large and I do not want to slow down the system). Glassfish forwarded these pages to 8181 port (which is HTTPS port). Everything is ok for the java part. However flex defines the 8181 port as a different domain and then problems arise. Due to flash's same-origin policy it cannot load the secured content. Normally a crossdomain.xml is the solution but I am accessing content of the same domain through a different port. What will be the solution ?
View 1 Replies
Oct 18, 2011
I have a flex application that dynamically loads swfs and I want to to use a set of color pickers in an external component within the application to determine a color array in the loaded swf.
I figured that I can use a new array of the colorPickers, i.e.
public var colors:Array = new Array [ cp01.selectedColor, cp02.selectedColor, cp03.selectedColor, cp04.selectedColor, cp05.selectedColor]
Is it possible for the swf to read the Array if it's set up like that? If so what would I put into the swf to get it? If not what do I need to do?
View 1 Replies
Mar 23, 2007
I'm trying to change the text on a textbox called "text1" that is part of a movieclip called "menulist" using actionscript. How can I access text1 with actionscript?[code]
View 6 Replies
Dec 10, 2007
My flash project is structured as follows, with the nested external swfs being loaded to clip holders using loadMovie():
home.swf
|--sponsors.swf
|--educators.swf
In home.swf, I've defined a text box with instance name contentWindow_txt, and assigned its path to _root.cw_txt. Now, when I type the following anywhere in home.swf:
Code:
_root.cw_txt.htmlText = "testing!";
The dynamic text box contentWindow_txt will display "testing!" when the swf loads. Unfortunately, when I make the same call in sponsors.swf, I get nothing. Is there something about external swfs or variable inheritance I don't know?
View 9 Replies
Feb 18, 2008
I have some variables declared on the root timeline that I need to access from some MovieClips. In AS2 I would do something like this _parent.myVar from within my MovieClip. I intend on getting fully up to speed with AS3 but right now I need a quick fix.on the root timeline I have a variable : var myHitTest:Boolean = false;My MovieClip needs to access this var so I tried it several ways listed here. I've had no success.
parent.myHitTest:Boolean
root.myHitTest:Boolean
Stage.myHitTest:Boolean
[code].....
View 6 Replies
Jul 23, 2009
I am able to access main root from an external swf by doing this:
MovieClip(root.parent.root)
but how to avoid getting an error when testing external swf alone? Is there any try catch system I can do to avoid thoses errors?
View 1 Replies
Aug 17, 2009
im attempting to keep it as portable as possible so its easier to edit later, and i dont have to go around copying/pasting too much code. - i'll cut to the chase..
On my main timeline, i load all the image-file names, as variables.. using loadvars into thumbnails, which ive given instancenames Loader_1 to Loader_20, inside these thumbnails is the Loader component Thumb_1. Here is the code on the main timeline, to load these variables.
Code:
BigLoader._visible = false;
var my_lv:LoadVars = new LoadVars();
// load variable function
[Code]....
how i could make this more portable without -completely- changing the format its in [so i can still understand it]
View 9 Replies
Jun 13, 2009
Basically I have a _mc that I am calling in from the library. When I get to the end of the clip I want it to advance the root time line to frame 3.This is the code I have at the end of the _mc
MovieClip(root).gotoAndStop(3);
This is the error I get :Error #1009: Cannot access a property or method of a null object reference.at introScene/frame91()
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@44370ba1 to flash.display.MovieClip.
View 2 Replies
Nov 15, 2010
I have declared a object in my 1 st frame of application.
ActionScript Code:
var objTest:Test = new Test();
I am tring to access the object from a movie clip. Movie clip is located in frame 2. I am getting error
ActionScript Code:
this.parent.objTest.IncrementCount();
trace(this.parent.objTest.QuestionCount);
1119: Access of possibly undefined property objTest through a reference with static type flash.displayisplayObjectContainer.
How to access a object instantiated at root from a movie clip.
View 1 Replies
Feb 25, 2010
I have declared a object in my 1 st frame of application.
ActionScript Code:
var objTest:Test = new Test();
I am tring to access the object from a movie clip. Movie clip is located in frame 2. I am getting error
ActionScript Code:
this.parent.objTest.IncrementCount();
trace(this.parent.objTest.QuestionCount);
[code].....
View 4 Replies
Nov 16, 2010
I have declared a object in my 1 st frame of application.
ActionScript Code:
var objTest:Test = new Test();
I am tring to access the object from a movie clip. Movie clip is located in frame 2. I am getting error
ActionScript Code:
this.parent.objTest.IncrementCount();
trace(this.parent.objTest.QuestionCount);
[code].....
View 3 Replies
Jan 13, 2011
I am migrating to AS 3.0 from AS 2.0 and I am unable to access the root of the main swf from the loaded swf. In AS 2.0 i simply used "_root.gotoAndPlay(frame number); I have also tried Movieclip(this.root).gotoAndPlay(frame number); but it doesn't work.
View 1 Replies
Feb 5, 2010
I have a swf called anim1.swf acting as a preloder and loading anim2.swf. anim1.swf is attached to a document class called Racine.as. Once anim2.swf is loaded, how can I target the root of anim2.swf?
For example, anim2.swf contains 2 clips called clip1 and clip2. clip1 contains a child called clip1_1. How can I access clip2 from within clip1_1 by using an absolute way (I don't want to use the parent property)?
N.B : a way would be to have a document class attached to anim2.swf, but here there is none.
View 5 Replies
Aug 5, 2008
I was checking my policyfiles log file and noticed that I have the following for a newly created (and played in Firefox) SWF file I made:OK: Root-level SWF loaded:URL...I was trying to find some documentation in livedocs.adobe.com but couldn't find anything...
View 1 Replies
Nov 24, 2009
Is it possible to tell an externally loaded swf what its root is?
These swf's I want to load in:
main.swf --> manager/g1/viewer.swf
In the main.swf I want to tell the viewer.swf:
your root = ../manager/g1/
So the viewer.swf can read the external xml and images from its own root. (../manager/g1/)
View 0 Replies
Mar 25, 2011
Ive a quick question on using root property when swf's are loaded in other swf's. Is it safe/wise to reference MovieClip(this.root) in packages/classes if the swf will be loaded and placed inside another swf? I read once that root will always refer to maintimeline, and all objects have the same root. So...will the root change in some way if a preloader loads the main swf?
View 5 Replies
Jan 13, 2011
I am migrating to AS 3.0 from AS 2.0 and I am unable to access the root of the main swf from the loaded swf.In AS 2.0 i simply used "_root.gotoAndPlay(frame number);I have also tried Movieclip(this.root).gotoAndPlay(frame number); but it doesn't work.
View 3 Replies
Jul 26, 2010
Can I control my main timeline with an externally loaded swf?
View 9 Replies
Oct 17, 2007
I am forced to develop in AS2 for Flash Player 6 with dial-up speeds in mind (client imposed limitations - dark scary limitations *shudders*).The client requires a swf to load into a flash application dynamically.I am worried about this 'cos there are a number of _root objects, movieclips, initiated classes and variables at the _root level.I don't want the client to be able to load in the external swf with code referencing the _root that could potentially interfere with my _root items (potentially exploding my universe!).Is there a way to change the scope of _root and _level0 for the target mc the swf is loaded into?Can I simply disable _root and _level0 for this clip?I would prefer a non-class method to achieve this if possible as I am loading all class scripts at frame 2 and all shared library elements, xml and the offending swf in frame 1 - all for accurate preloading purposes (that whole dial-up thing again ....)
View 2 Replies
Dec 12, 2009
I'm loading a lightbox as an image gallery, but I'm working on changing it to full flash. My site is structured with external swfs. I ran into a barrier, because I'll need to load the images (and reference the stage size) in the root timeline, but I don't know how. MovieClip(root) only references the smaller loaded swf's main timeline.
View 1 Replies
Jan 13, 2011
I am migrating to AS 3.0 from AS 2.0 and I am unable to access the root of the main swf from the loaded swf.
In AS 2.0 i simply used "_root.gotoAndPlay(frame number);
I have also tried Movieclip(this.root).gotoAndPlay(frame number); but it doesn't work.
View 1 Replies
Oct 20, 2010
How can I access variables defined on root from a loaded movieclip? The loaded movieclip path can differ, so I cannot get to root like parent.parent, for example. I thought something like this.root.varName may work, but it obviously doesn't.
View 3 Replies
May 13, 2011
Does anyone know the best method to trigger a function in the root from a dynamically loaded movieclip (loaded using addchild) using AS3, I understand targeting root is not the best way to do this?
View 2 Replies