ActionScript 3.0 :: Access Loaded SWF From An External Class?

May 3, 2010

This situation is rather tricky because I'm having to control movieclips/properties in both the Parent and Child SWFs.

The path I took was not to have a slave document in the loaded SWF as it was looking for all the library movieclips I was referencing in the Parent. I didn't know how to resolve that easily, so I decided to to refer to the Loaded SWF movieclips using an instance of the class onComplete[code]...

View 2 Replies


Similar Posts:


Actionscript 3 :: Access Function In External Class Located In External Swf

Oct 22, 2011

I am trying to access a function in a loaded swf that has external class.. I would like to avoid having to put the function on my "Main" Doc class in the external swf and instead access the function directly from the class

This is what ive tried so far and it's a no dice:

private function startLoad(){
var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("one.swf");

[Code]....

View 1 Replies

ActionScript 3.0 :: Access Class Library Of Loaded SWF?

Dec 4, 2009

If it's possible to access the class library, i.e. instantiate custom classes, from a loaded external SWF file?

I have a sprite on the stage with the instance name "speakers". I've got this working so far[code]...

View 8 Replies

ActionScript 2.0 :: Can't Access External Loaded Clip?

Sep 17, 2009

No matter what I try to access this swf..._root, _parent, _level0, etc...I can't get to it. I did a targetPath and it returned "level0"...so I'm not sure what I'm missing.

Code:
var player1holder:MovieClip = _root.createEmptyMovieClip("player1holder", 0);
var player1loader:MovieClipLoader = new MovieClipLoader();

[code].....

View 1 Replies

ActionScript 3.0 :: Access Property Of Main Class In Loaded Swf

Aug 28, 2010

i have one main.fla, its document class is main.as. the code in main.as is package.[code]where val is the property of Loading class.so how can i access.

View 2 Replies

ActionScript 3.0 :: Access Data Loaded By XML Loader Class?

Oct 26, 2010

I'm having troubles accessing the data loaded by external class.[code]...

Now, I want to create another external class (called MainMenu) that will be initiated from the Main class.This class should create the menu based on the loaded XML class.

My question is, how can I make use of the loaded XML content via XMLLoader class within the MainMenu class?

View 16 Replies

ActionScript 3.0 :: Access A Loaded External Movie Contents

Feb 6, 2009

after loading an external movie clip called "mv_frame" into the main flash file , i need to access a movie clip inside the loaded movie called "hit" in as2 we do that using the point (.) to navigate into movie levels , but my question is how to do that in AS3?

View 2 Replies

ActionScript 3.0 :: Access Function In External Swf Now Being Loaded By Preloader Swf?

Jul 1, 2010

I have followed the tutorial on gotoandlearn that builds a preloader swf to load an external swf. The problem I am having on the main timeline is that I now cannot access a function in the final external loaded swf. This worked fine when I just loaded the external swf into the main timeline but with the preloader I think I have my loader instances confused and I don't know how to fix it.

[Code]...

Like I said this worked perfectly before I tried cleaning things up with intermediate preloader swf and now its all gone pete tong (again!!) When testing this by reviewing the main timeline it cannot recognise the function killStream

View 0 Replies

ActionScript 3.0 :: Root Access To Method In Document Class From Loaded Swf

Jan 26, 2010

Im having whta I think is a quite common problem. I recently started migrating form AS2 to AS3 and Im buidling a home made template for all AS3 projects..

I have just loaded portfolio.swf on top of main.sfw. The buttons on portfolio.swf share the same class as the buttons on main.swf

This is the button class:

Code:
package com{
import flash.display.*;
import flash.events.*;

[Code]....

View 9 Replies

ActionScript 3.0 :: Class To Access External XML?

Jul 31, 2009

So I have a class that reads from an external XML file, and it works great. (uses RLRequest and complete event listener)I have functions in it to read certain parts of the file.Im trying to create a new instance of that class in my document class. I am able to do this, BUT because the XML class loads the file, and uses a complete event listener to load it, anything I try to access (var or function) come up blank because it fires before the file is done being loaded.Id like to be able to do something like this.

Code:
var prefs:XMLClass = new XMLClass();
var localcolor:uint = prefs.color; (access the public variable color)

[code]....

View 2 Replies

ActionScript 3.0 :: External Class Access?

May 24, 2010

I've a website in which i have a menu that handle some external swf.My Problem is that when i've clicked on one section of the website and then i click on another menu button to gain access on another section i wanna to make an "go out transition" for the current loaded section. This transtion must be different for every website section, so for this i'm going to create a "go out transition" in every external swf class that i have for every section.Now my question is: How can i access from the main class to every single classes of the section to obtain the properly "go out transition" ?

View 9 Replies

ActionScript 3.0 :: Access .fla Library From External Class?

Jun 3, 2010

I have a folder with my .fla, and a folder called "classes" where I stored all my classes. I'm trying to access a MC in the .fla file so that I reference it from one of those classes in the "classes" folder. for you visual learners...

Code:
<project>
project1.fla <- library here

[code].....

View 3 Replies

ActionScript 3.0 :: Access Library From External Class?

Oct 23, 2011

have an external class which controls about 400 buttons. But I want this class to also be able to show a Popup window. But this would mean I would need to access the Library.Within this library would be a MovieClip exported for Actionscript with the name PopUP.WITHIN the fla it's easy:PHP Code:va popUpWindow:PopUP = new PopUP();addChild(popUpWindow);

View 4 Replies

ActionScript 3.0 :: Access Main Class Function From External?

Feb 9, 2009

I'm quite confused about how to do it, look at this [code]...

View 2 Replies

ActionScript 3.0 :: Access Clip On Stage From External Class?

Feb 13, 2009

I've got a textfield on the main Fla called 'debug'i've created a Class which refers to the textfield, but when i launch my fla, it says:1120: Access of undefined property debug.

ActionScript Code:
package {
.....

[code]....

View 9 Replies

ActionScript 3.0 :: Access MovieClip From External Class File?

Jan 19, 2009

I am currently using an external Class file for an instance in my .fla project. It creates an instance of that specific class and has it carry out some functions.I want to access a MovieClip on the stage in the .fla file in the external Class file. How can I do this?For example, the Class file creates an instance of that class, and I want the x and y coordinates of that instance to be equal to that of let's say circle_mc. Now circle_mc is on the stage of the .fla file, and therefore cannot be accessed. How can I get around this?

View 5 Replies

ActionScript 3.0 :: Access An External Class In An Existing Fla File?

Dec 20, 2010

I have an Existing FLA file (It is my Project file) and I have downloaded one good example Class file with Fla. But there is no code at all on the stage just it is retrieving instructions from the Class. How can I use this class file in my existing fla file.

View 3 Replies

ActionScript 3.0 :: Access An Object That Has Been Made In A Class In An External AS Document

Sep 12, 2009

I'm using the following code to arrange indexes of objects on the stage the only problem is I can't access an Object that has been made in a class in an external AS document. if i go into the document and trace I can see it but i can't access it from the document class and arrange its index anybody have any ideas?

[Code]...

View 1 Replies

ActionScript 3.0 :: Get Xml Loaded From The External Document Class

Feb 4, 2010

trying to get xml loaded from the external document class. I've tried several tutorials on this as well (although I think they are mostly for doing it within the timeline). This is in the main document class that is also doing a bunch of other stuff, but all the other stuff works.

[Code]....

View 4 Replies

ActionScript 3.0 :: Preloader For External SWF Loaded Via Loader Class

Oct 15, 2010

I'm hoping to implement a preloader on a main.swf that measures the bytes etc loaded in an external.swf. My two concerns are that 1) this just isn't possible? 2) I can't have multiple preloaders on the main.swf, which I would if I used one for the external .swf. I intend to try and explain this in the best way I can what I have done so far, as I personally feel this is quite a complex task.

Here's the basics:
I have an external .swf file, being loaded, using the following Action Script (3), in what I shall call, main.swf:

//---loader---
var swfLoader:Loader = new Loader();
addChild(swfLoader);
var swfURL:URLRequest = new URLRequest("nameofswftobeloaded.swf");
swfLoader.load(swfURL);
function loadHandler (event:Event){
var thumbsPanel:MovieClip = event.target.content;
addChild(thumbsPanel);

This works fine. The Action Script I use after this simply allows me to control the external .swf from the main .swf so isn't necessary.. I finish the loader, with this:
"swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);"
So, this all works fine. However, as the external .swf contains images, it doesn't load instantly. I therefore need some kind of preloader to show how much of the external .swf is loaded. However, I tried placing this in the external .swf itself and it failed miserably - for some reason it basically didn't preload and the completed phase of the preloader just appeared.

View 1 Replies

ActionScript 3.0 :: Get Externally Loaded SWF To Act As Movieclip From External Class?

Jan 21, 2009

I have a problem - when I load a swf and I want to be able to add event listeners to propertys on it I use the code

ActionScript Code:
var headerMovie = MovieClip(loader.content);

Which works fine but what I've have created now is a class to load external SWF's and add them saving me to repeat that code, which works fine for loading the swf but as for the part where I get it to convert to MovieClip (which is what I assume that bit of code does) I'm out of Idea's.here is the class so far - the error it gives is that it cannot acces the property mloader, I've even declared it outside of the function but to no avail.

ActionScript Code:
package {
public class PreLoaderSwf3 extends MovieClip  {
var myTween:Tween;

[code]...

View 5 Replies

ActionScript 3.0 :: External SWF Loaded Accessing Loader Class?

Feb 2, 2010

I have a Main.fla (with Main.as as document class) that calls the external SWF (which has its own document class too)

ActionScript Code:
function startLoad() {
mLoader = new Loader();

[Code]....

Another question. Is it possible to do some kind of listener? Example, I call this external swf, and if the user press a button inside this external swf, this button triggers the listener on the Main.as? Something like running an external mini game, and wait for the results/hiscore.

View 0 Replies

ActionScript 3.0 :: Flash - Access Player.x And Player.y From External Class?

May 8, 2011

I am trying to put together a simple game and have been doing really well until I decided I am going to have to create a new class to handle enemies.What I have so far is a player walking around on random terrains and I am up to the point where I have placed x amount of enemies on stage at appropriate times. I have written their class which will hopefully eventually handle their behavior and it outputs simple trace("BOO!").

Where I face the problem is that I obviously would like to make these enemies follow the player to attack. But when I try to access the .x or .y attributes of the player, it throws an error: 'call to a possibly undefined property with static type Class'?I have tried accessing the .x using the following ways (where badger is my player instance and Main is my class definition within the properties of the FLA):

Main.badger.x
Main(root).badger.x
Stage.badger.x

I have also tried to access other vars and still nope..My class code is this:

Code:
package
{
import flash.display.MovieClip
import flash.display.Stage

[code]....

View 1 Replies

ActionScript 3.0 :: Using An External Class To Reference Functions From Another External Class?

Mar 25, 2010

I have a Main.fla which loads Main.as as its document class. In Main.as I have a public function named "Main" which runs a trace. I also have another .as file called Preloader.as, which also has a public function in it, this one named "Preloader" with simple trace in it. I just cannot figure out how to use Preloader() from the Preloader class in Main() from the Main class. Main.as loads up fine when the SWF loads and traces.

View 10 Replies

Flash :: Access Object Property Or Function On Extended Class That Isn't In The Super Class?

Jan 29, 2012

If I have three classes:

public class Example {
public function Example () {
}[code]............

You can see that the two last classes extend the first one, and both have the 'variable' property. In case that I have an instance of Example and I am sure it is also an ExtendedExample OR AnotherExtendedExample instance, is there some way to access the 'variable' property? Something like

function functionThatReceivesAnExtendedExample (ex:Example):void {
if(some condition that I may need) {
ex.func()

View 3 Replies

Actionscript 3 :: Access Variables In Main Application Class From Instantiated Class?

Apr 8, 2010

I have a initApp.as which instantiates a class which needs to access the "currentState" property and the States array as well. However we cannot get this to work as we cannot see how we can access this information.

Within initApp.as currentState is accessed via "this.currentState". This does not work in the class which is instatiated within initApp.as. The following error is thrown:

"Access of undefined property currentState."

View 1 Replies

Actionscript 3 :: Access A Public Property From AvEniroments Class Through The Player Class?

Nov 24, 2011

I have the following inheritance structure:

var environment:AvEnvironment = new AvEnvironment(...);
addChild(environment);
environment.addChild(new Terrain());
environment.addChild(new Player());

I am trying to access a public property from AvEniroments class through the Player class, however I'm getting an undefined property error (#119). I've tried the following:

this.x = AvEnvironment.xs // public property in this class
this.x = parent.xs

I've also tried something like this:

var ev:AvEnvironment = AvEnvironment(parent);
this.x = ev.xs

but I get a TypeError. Error #1009: Cannot access a property or method of a null object reference.

View 1 Replies

Actionscript 3 :: Access A Displayobject On Stage In A Class That Is Not A Document Class?

Mar 7, 2012

How to access a display object on the stage in a class which is not a document class?

I am looking for a solution that doesn't involve passing the stage as a parameter to the class.

One solution i always come across is using "TopLevel.as". Is it a good method because as far as I have heard using global variables is not recommended because it might cause some problems while working on big projects.

View 1 Replies

ActionScript 3.0 :: Access The Stage Property From A Different Class That's Not The Principal Class?

Jul 2, 2009

I was wondering how do you access the stage property from a different class that's not the principal class tied to the fla? Essentially, I have main.as which calls another class menu.as, and I can't seem to be able to use the stage.stageWidth property from menu.as. What's the proper way to be able to use the stage property from any class? Do I have to import it separately each time?

View 2 Replies

ActionScript 3.0 :: Flash Access TextField From Class Imported By Doc Class?

Aug 17, 2010

I'm just now learning the new object oriented way of scripting. It's been a wild ride, but I've finally learned how to keep script off my frames (very hard coming from as2).Here's my problem:

I have a TextField on the stage in my main .fla file named loadPercent.

I'm loading a jpg with preLoad.as and displaying the bytes loaded in loadPercent.

I can access my loadPercent TextField from my MainClass

but I can't access it from preLoad.as

the document class is MainClass.as

Code:
package
{
import flash.display.MovieClip;[code]....

I get three '#1120 access of undefined propery' errors for each time i try to access loadPercent.

a few basic questions: 1. all my files are in a folder in my documents, not in the flash directory, is this bad? I've seen people using com.whatever etc.

2. my main .fla file does not share the same name as my MainClass.as (it's not named MainClass.fla) Is that a problem?

I'm assuming these are inconsequential because my code seems to work up to a certain point.

View 7 Replies







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