ActionScript 3.0 :: Accessing Parent Variables In Externally Loaded Swf?

Jun 24, 2009

here's what I have (simplified to only show necessary code):

Main Timeline:
var currentItem:String = 'applesauce';
(then some code to load an external swf)

[Code].....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Accessing Variables And Functions From Externally Loaded Nested Clip?

May 23, 2009

How would you go about accessing a function or variable from a parent clip if the clip accessing has been loaded using the Loader() constructor in AS3?

View 1 Replies

ActionScript 3.0 :: Accessing Externally Defined Variables?

Aug 22, 2009

Here is the problem:I have 2 external as3 files in a "com" folder next to the FLA within which i am working. The first of these ( "Main.as") is the document class. The second ("events.as") contains variable definition "myVar:Number = 0" which i want to be able to access and change inside Main.as. I am sure that this is possible, but i can't get it working (flash very keeps pointing out that I have made an error. Specifically that old classic: "1046: Type was not found or was not a compile-time constant: myVar." which has puzzled me since the dawn of time.

View 3 Replies

IDE :: Accessing Library Of Externally Loaded Swf?

Jan 17, 2010

I have a swf file which contains in its library couple pictures. After it is loaded using preloader I would like to be able to create couple instances of them and add them to the stage

If I use swc approach and import it in library path I can not preload it but instancing is very simple i.e

Code:
public var pic:Pic1 = new Pic1();

and that's it, I can add it then to stage then.

How to access them when doing it with swf and loader class?

View 1 Replies

ActionScript 3.0 :: Communication From Externally Loaded SWF To Parent

Mar 19, 2009

In short, this is what im trying to do: Communicate from externally loaded swf to main/parent .swf. On my main .swf I have this code on my main timeline to import and center an external .swf:

Code:
import flash.display.*;
import flash.net.URLRequest;
//turn off stage auto resizing
stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
[Code] .....

View 1 Replies

ActionScript 3.0 :: Air 1.0, Externally Loaded SWF Accessing Camera

Jan 21, 2011

I am building a touch screen kiosk Air App using Flash CS3 and Air 1.0.
 
I have my application downloading external SWFs for different advertisements, one of which will need access to the webcam built into the kiosk.
 
By itself, the advertisement accesses the camera just fine, however Camera.getCamera() returns null when it the SWF loaded into the kiosk app. Both the main kiosk app and the advertisement app are compiled using Air 1.0.
 
It appears that I'm getting a security sandbox violation, however I'd like to avoid completely rewriting my app using the sandbox bridge architecture just so one of my ad pieces can access a webcam.
 
Does anyone have any suggestions or know of any work-arounds for allowing webcam accesss from within an embedded SWF in Air?

View 1 Replies

Accessing A Class From An Externally Loaded Flex SWF?

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

ActionScript 2.0 :: Accessing Movieclips In Externally Loaded .swf

Aug 10, 2009

I am a newbie to AS 2.0..I only have basic actionscript 2.0 knowledge."I have one main .swf file and several external .swfs which I am loading through this code.[code]Now my problem is that I would like to access one "close_mc movieclip" in ourGroup.swf ...so that clicking that clip, I can exit the externally loaded .swf from the main .swf file."

View 3 Replies

ActionScript 3.0 :: Accessing Buttons On Externally Loaded SWF

Feb 22, 2012

I have loaded an external swf into loaderTopBanner. It works to manipulate that, but not the individual buttons within it. (e.g. btn_Home, btn_Info)
loaderTopBanner.btn_Home.alpha = 0;

View 2 Replies

ActionScript 3.0 :: Accessing Stage Of Externally Loaded Swf?

Jul 22, 2009

I am loading an SWF created in Flash CS4, using the 3d translation tool.The SWF is being loaded into an application being build in as3 in flex builder 3.I can manage to load the movie however the stage has disappeared. All of the objects that exceed the boundaries of the (banner) remain visible instead of being cropped by the stageI attempted to mask the swf before publishing which did not work, and I attempted to programmatically assign a mask once it was imported which also did not work.None of these options threw errors, in most cases they either had no effect whatsoever or the movie simply disappeareI've read numerous posts on this and the answers always seem to be vague.Based on my research I need to access the stage properties of the SWF being loaded, but am unsure how to go about it.Do I need to compile the movie, export a swc and add it to the build path for the project?Do I HAVE to use a document class for the SWF I want to load in order to access it?Do I need to add anything else to the source or build path for the project in Flex Builder?

View 5 Replies

ActionScript 3.0 :: Accessing Properties For An Mc In An Externally Loaded Swf?

May 24, 2010

I am trying to set a couple of properties (specifically width and height) for an mc within an externally loaded swf but am having bigtime troubles. Keep getting the 'Error #1010: A term is undefined and has no properties'. The code is attached below. I have tried to figure this out and searched for solutions but could not resolve this myself.

import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;

[code]......

View 1 Replies

ActionScript 3.0 :: Remove Externally Loaded Swf And Tell Parent Swf GotoAndStop(1);

Mar 27, 2009

This is the code I use to load an external swf into a movieclip. It works.

var thisMovieClip:MovieClip;
var myHBIMovieLoader:Loader = new Loader();
myHBIMovieLoader.load(new

[Code]....

View 1 Replies

ActionScript 3.0 :: Accessing Document Class Of An Externally Loaded Swf With AS3

Aug 5, 2010

I have loaded one swf externally in my main class. and there is one button in loaded swf suppose its name submit_btn. i have to do that when i click on submit_btn, this loaded swf should be removed. what is the code for that

View 1 Replies

Actionscript 3.0 :: Accessing Library Items From An Externally Loaded SWF?

Aug 11, 2009

I'm slowly working my way through AS3, and have a question about how to do this. In as2, you could just load a swf file, then use attachMovie("itemLibraryLinkageName");. I know in AS3 you have to use addChild() to add items to the display list, but how would you go about adding the library items to the stage from an externally loaded swf in AS3? I've tried:

Code: Select allvar library:MovieClip;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);[code].......

View 2 Replies

ActionScript 3.0 :: Accessing Superclass Methods On An Externally-loaded SWF?

Jul 27, 2009

I'm trying to set up a large project that has a "shell" application that preloads and eventually displays a bunch of SWFs as a "slideshow". Each SWF could be authored by different people but will reference a base document class so they exhibit consistent behaviour. One of these behaviours is to be able to localise the slideshow into different languages. Since each SWF could have a different number of textfields that need to be localised embedded into their main timeline, the SWFs each must declare their stage instances in their document class. In order to implement the common functionality (such as a "localiseText()" method), I have decided to package all common functionality into a superclass (what I'm calling "Base Class" in this example) and using a subclass as each slide's document class.

This Example:This is a simple example I set up because in my actual project my compiler was throwing a coercion error when I tried to cast the Loader.content as my external class. The structure of this example is the following:

+ loader.fla : this is the main "shell" application.
+ SWFLoader.as : the Document Class for loader.fla
+ external_1.fla : this is the external SWF file that will get loaded and displayed

[code]....

I've set it up this way because a hypothetical external_2.fla might have different public variables to declare its stage instances so would need a separate implementation of ExternalBase (presumably External2.as).

The code (in reverse):

base/ExternalBase

[code]....

This just sets up the localiseText() method which is used in this example to change the contents of the text field. Since we don't know the name of the text field in the particular slide's timeline, we have to ask for it from the subclass' implementation of getLocalisableTextField(). We declare an abstract function here that needs to be overridden in the implementation.

[code]....

View 11 Replies

ActionScript 3.0 :: Flash - Accessing Classes From Externally Loaded Swf's?

Apr 30, 2011

I have a document class which links to several classes, one of which adds a container onto the stage and loads external .swf's into it.Q: How do I access the various classes loaded in the document class from the external swf timeline?For instance, when you click a button in the loaded swf it changes the soundtrack from the soundtrack class. I have tried dispatchevent from the external swf timeline, but I still can't seem to get it to work. Is this supposed to work, or should I be doing something different?

View 1 Replies

ActionScript 3.0 :: Accessing Parent's Variables

Mar 8, 2010

I'm trying to access the AchievementScreen's textfield from a medal object. Point being to have a mouseover event of the medal, change the content of the textfield shown. I tried a trace first: trace(this.parent.parent.parent.parent.textLineCon tainer); 1119: Access of possibly undefined property textLineContainer through a reference with static type flash.displayisplayObjectContainer. trace(this.parent.parent.parent.parent) shows me it is a AchievementScreen object. textLineContainer is the instance name of the MC nesting the textfield (I actually drew the achievement screen then exported it to actionscript.

[Code]....

View 11 Replies

ActionScript 3.0 :: Control Of Externally Loaded Child Movieclip Timeline From Parent?

Mar 3, 2009

I have a basic xml driven portfolio. The xml file holds the path to the portfolio pieces (external .swfs). I have a main navigation that moves from project to project and a subnavigation to view individual pages of that project.The subnav is where I have the problem, I simply want to call gotoAndPlay("framelabel") of the designated mc. It seems that you can no longer call to the timeline of child movieclips as you could with AS 2. I've found some examples Except the examples discuss access of nested movieclips on the stage with assigned instance names. But the problem I'm facing is that I have each item pulled in via the loader Class then the objects are pushed into an array and my subnav needs to access them dynamically via array notation.something like this:

PHP Code:
public function loadMe(){
//var l:Loader = new Loader();

[code].....

View 12 Replies

ActionScript 3.0 :: Child Accessing Parent Variables?

Sep 6, 2010

What's the strategy for getting a child to access variables in a parent.I have a Main class.In that class I create instances of a Unit class and save those to an array.In the Unit class, I want to access the x and y coordinates of other instances of the Unit class.So I'd like to access that array I made in the Main class.I tried:this.parent.theArray[i].xbut that doesn't work. I tried using the get command, but I don't really know how to, so my efforts failed.

View 3 Replies

ActionScript 3.0 :: Accessing Variables From A Parent Movie?

Nov 10, 2009

i am trying to make a basic preloader for an AS3 site. I followed the tutorial on this site (Preloading actionscript 3 the easy way) where its similar to AS 2 - create a Preloader movie and load the whole .swf into it.

only problem is i need some variables that i pass to the movie via QueryString parameters in the Object and embed tags. Is there any way to get this in my loaded movie?

i have tried
root.loaderInfo.parameters
and
stage.loaderInfo.parameters
and
parent.loaderInfo.parameters

none of them work. Can i create a variable in the prelaoder and just go "parent.thevariable" ? or does parent even work when something is loaded into a loader?

View 1 Replies

ActionScript 3.0 :: Accessing Variables Of Child Swf From Parent?

May 4, 2010

I have TestA.as the base class file for my TestA.fla that has nothing but a movie clip with instance name box.

TestA.as

ActionScript Code:
package
{
import flash.events.MouseEvent;
import flash.display.MovieClip;

[Code].....

View 0 Replies

ActionScript 3.0 :: Accessing Parent/child Variables?

Nov 22, 2010

I have a movieclip walls and a movieclip character (both on the same timeline). I want to access and change a variable inside character from the walls timeline.

ActionScript Code:
MovieClip(parent).character.somevariable = true;
...not working.

View 2 Replies

ActionScript 3.0 :: Accessing Variables Between A Parent And Child Swf

Feb 11, 2011

Wondering how to do this:

Parent swf has a class loaded, lets call it 'GlobalUtilities'. Parent swf loads in child swf. Child swf wants to use some of the 'GlobalUtilities' class that is in the parent.

How can I accomplish this? The problem I'm having right now is, when I export the child swf, I'll just error out since it can't find the reference (obviously, since it's not loaded into the parent yet).

View 3 Replies

Actionscript 3 :: Accessing Variables Of Parent Class From Child?

Apr 11, 2010

i'm trying to assign a parent's variable from the parent's child

//Parent
public class Main extends Sprite
{
public var selectedSquare:Sprite;

[Code]....

i'm receiving this error, but i'm casting parent from displayObjectContainer to a Sprite so i have no idea why it's not working.

1119: Access of possibly undefined property selectedSquare through a reference with static type flash.display:Sprite.

View 2 Replies

ActionScript 3.0 :: Accessing Parent From A Loaded Swf

Jun 8, 2010

Well, I know how to access the loaded swf variables from its parent, but how do I access the parent SWF variables from a loaded SWF?! I'm trying it.. But get no results.

View 6 Replies

ActionScript 3.0 :: Passing Variables To Externally Loaded SWF?

Jan 30, 2011

how can I pass variables to externally loaded SWF written in AS2 ?

View 0 Replies

ActionScript 3.0 :: Access Variables Of Externally Loaded Swf?

May 12, 2011

I'm loading external swf's in a main swf, which are contained into a container "thisMC" which is a movieClip.

Now I've got various variables in these external swf's and I want to access these variables into my main swf.

eg - var myString:Variable = thisMC.myNumber;
trace("Whats the value "+myString);

o/p Whats the value undefined.so if myString is a variable that i've defined in the main swf and myNumber is a variable defined in the external swf, if I try accessing it like this , this is what I'm getting.

View 3 Replies

ActionScript 2.0 :: Make An Externally Loaded SWF And Variables

Feb 25, 2004

I'm tryin to do catalog on CD using flash. There will be 15 pages of items w/ the selections. The coding I'm using for their options is from this: [URL] Now my question is, since I can't use a DB because it's on a CD, I have to pass the variables through flash. But when they are done making all their selections how do I make an externally loaded SWF using this command:

[Code]....

read the final values that were selected on the specified pages? I've read lots of the threads concering passing variables and none of them. Also if anyone knows of any way to hold a DB on a CD and be able to write to it as well as read from it lemme know

View 8 Replies

ActionScript 2.0 :: Externally Loaded Txt And Urls With Variables

Jun 24, 2005

I've built a dynamic scrolling textbox that loads external text and formats it via css. Everything works as it should except I need to add some links in the text file that contain variables (i.e., something like this: [URL]

Flash will not interpret this properly as a normal html link in the loaed text file.

View 1 Replies

ActionScript 3.0 :: Passing Variables To And From Externally Loaded SWF?

Jul 13, 2011

Then there is an external SWF that is loaded by main.swf. I am trying to get this external SWF to check the value of "myVar" and depending on what the value is, send the playhead in the main.swf to a certain frame. have it almost working, but it is giving me problems. And I am not sure it is the best way to do it.On the timeline of main.swf is a movieClip called "BG". It has 6 frames. the first frame declares that variable, and each of the other 5 frames, set the value of it. I need the external swf to check the value of "myVar" to detemine where to send the playhead of the mian.swf. So on a frame in the external SWF, I have this code:

Code:
MovieClip(parent).addEventListener(Event.ENTER_FRA ME, fl_EnterFrameHandler); function fl_EnterFrameHandler(event:Event):void { dispatchEvent(new Event("myVar_value", true)); }

[code]......

View 13 Replies







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