ActionScript 3.0 :: Loading External Classes Into Document Class?

Sep 7, 2010

I am trying to load external classes into a document class and initialize the page by loading one of them (which loads xml and videos) I feel like I should be able to do this but have not found documentation on this. Below is the code i am using...

package {
import flash.display.MovieClip;
import flash.net.URLLoader;

[code]....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Loading External Swf Document Class

Jul 31, 2009

I have created a image gallery. it uses a document class and several supporting classes. It works great. I need to load that swf gallery.swf into a another movie. When I try to do this I get this error. TypeError: Error #1009: Cannot access a property or method of a null object reference.at oxylus.rotator::Main()oxylus.rotator.Main is my document class for the gallery.swf that is being loaded into another flash movie.I don't get why it would cause errors as its a compiled swf and should not have references to that class.

View 1 Replies

ActionScript 3.0 :: Loading External Swf - Works From Document Clas, But Not From A Different Class?

Nov 1, 2009

This is simple, however I am having trouble. I am adding a swf to the stage in my Document class (Test.as) - it works. I am trying to add the same swf to the stage in a different class called Control.as, it doesn't work. Can someone please help and explain what I am doing wrong?

// Document class Test.as
// Adding bg.swf to the stage - this works....
package ca.blah (

[code].....

View 4 Replies

ActionScript 3.0 :: Importing Classes Without Using Document Class

Feb 2, 2011

I have 2 as3 files, which are the classes used . I have to use it with the main flash movie.. How will I include those as3 files without using document class..

View 4 Replies

ActionScript 3.0 :: Access Vars Between Document Class And Other Classes?

Apr 19, 2009

For the example, there's a single FLA with a document class "main.as." In the public class main.as package, there is a public variable: "var example:String='example';." Inside of the FLA, there is one movie clip in the library and it is assigned a custom base class "sub.as." The movie clip is then placed on the first frame of the stage so its constructor is run at runtime and reads the value of example.

What is the proper way to get the value of "example" in the root document class? Using "root.example" in the sub.as class to target the document class returns an error and when I trace "root", I get "null." Main.example naturally throws an error because that's looking at the actual class and not the movie / stage its attached to.The round-about way I've done it before is to dynamically add the object in the library and pass in the root path when I create a new instance of it (example: submc:sub = new sub(this); ).Is there anyway to get back to the document class with a built-in method like root, etc?

View 2 Replies

ActionScript 3.0 :: Import Classes Without Declaring A Document Class?

Sep 25, 2009

The header says it all. I am trying to import a couple of classes without attaching a document class to the fla file. Is this possible? I have the class path set as appropriate (I think) in the publish settings since my fla is located inside a swf folder and my classes folder is located outside the swf folder. Its how my project is organized.

Class path set: "..classes"

View 8 Replies

Actionscript 3.0 :: Make Non-document-class Classes Aware Of Stage Comp?

Dec 2, 2010

I am working on text adventure game which will have at least a few components (a text area for narrative and text input for user input) on the stage at all times. Therefore, I have created those components statically through Flash's WYSIWYG design environment. I gave them instance names "myTA" and "myTI" respectively. I was able to get my main class (the document class for the stage) to interact with them (dynamically adding text one character at a time like a typewriter at runtime), but other classes in the same package don't seem able to recognize the stage components. Below is the relevant code:

Case A, in which everything happens within the Main class:
Code: Select allpackage {
public class Main extends MovieClip {

[code].....

View 1 Replies

Actionscript 3 :: Make Non-document-class Classes 'aware' Of Stage Components In Flash?

Dec 2, 2010

I am working on a text adventure game which will have at least a few components (a text area for narrative and text input for user input) on the stage at all times. Therefore, I have created those components statically through Flash's WYSIWYG design environment. I gave them instance names "myTA" and "myTI" respectively. I was able to get my main class (the document class for the stage) to interact with them (dynamically adding text one character at a time like a typewriter at runtime), but other classes in the same package don't seem able to recognize the stage components. Below is the relevant [code]...

View 5 Replies

ActionScript 3.0 :: Class Is Loading The File But When Return It To A New Xml Object In The Document Class It Doesnt Load It?

Aug 18, 2009

I found myself loading a new XML file every day and so decided to create a small class that will load the xml file and return it.The class is loading the file but when i try to return it to a new xml object in the document class it doesnt load it.I think that it's something to with the return being in a nested function but i tried a few ways and non seems to work.
 
[DOCUMENT CLASS]
loadXML:LoadXML = new LoadXML();
myXML:XML = new XML(loadXML.loadXMLFile("gallery.xml"));[code].....

View 1 Replies

ActionScript 3.0 :: Loading Swf Document Class?

Jan 24, 2010

I have a movie which is placed on the stage in the authoring environment, this movie is called LiftMovie. When the user clicks on a button in LiftMovie, it loads another movie into a placeholder called MallPlaceHolder and the LiftMovie has its visibility set to false.From the document class of the movie loaded into MallPlaceHolder, if the user clicks on the image of the Lift in the mall, I want it to make the LiftMovie visible again.

View 1 Replies

Flash - Loading SWF Without Instantiating Document Class?

Sep 26, 2011

Is there a way I can load a swf file but not automatically instantiate it's DocumentClass? Instead I want to do something like the following:
protected function mainLoaded(e:Event = null):void {
trace('mainLoaded');
var main:* = this.mainLoad.createClassByName('Main');
trace(main);
}
Where mainLoad is an instance of CasaLib's SwfLoad and createClassByName is the equivalent to
loaderInfo.applicationDomain.getDefinition();
The thing is that when my swf finishes loading I can see it is created, because of some trace calls, although its obviously not added to the display list.

View 1 Replies

ActionScript 3.0 :: Loading Document Class On 2nd Frame?

Dec 30, 2009

So I have created the main class for the .fla file but I want a menu screen before my game starts playing. However, because of my doc class loads on the first frame, I dont know how to control when the document class will start loading.

View 7 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 :: Flash - Dispatching An Event From One Document Class And Listening For It Via Another Document Class?

Dec 14, 2010

I am dispatching an event from one document class and listening for it via another document class.My code in class A.

Code:
this.dispatchEvent(new MYEvent(MyEvent.APERTURE_DONE));
trace("Dispatching APERTURE_DONE");

my code in class B.

Code:
addEventListener(MyEvent.APERTURE_DONE, onDoorsOpen,true);
trace("Lisetning for APERTURE_DONE");

[code]....

My listener is registering before the event is dispatched, based on my output window, however I never get the "Open Doors" trace statement to fire.

View 2 Replies

Actionscript 3 :: Class - Use External Classes In FlashBuilder?

Jan 30, 2011

I'm trying to implement CSVLib in an Air application and am getting an error that seems wholly illogical to me. "1120: Access of undefined property csv." and "1120: Access of undefined property completeHandler."

The only thing I can think is it's not importing the csv class properly, or the class itself is broken somehow? I know my import path is correct because I typed it out directly based on automatic hinting. The code below is copied directly from the how-to wiki on the csv lib site.

[Code]...

View 1 Replies

ActionScript 3.0 :: Accessing A MovieClip From An External As That Is Not The Document Class?

May 9, 2009

Instead of posting my entire files and such, I'll make a brief example of my situation and my desired outcome. My files consist of my document class entitled Engine.as and another class Abilities.as all within the same folder. On my stage I have a MovieClip with the instance name of item1_mc. On its personal timeline I have 2 frames, one entitled "inactive" and the other "active". Here's a sample of very similar code....

[Code]...

View 4 Replies

IDE :: Loading External Document Into Dynamic Flash TextBox

Jul 20, 2005

How I can load an external .txt document into a designated dynamic text box in my flash document. I've tried the two tutorials I could find on flashkit.com and neither of them worked for me. I did everything as told and still the text file didn't load. When I enter the actionscript into the editor, I'll click check syntax and I get an error!

Here's the code I have in the first frame of my actions layer:
stop();
loadText = new loadVars();
loadText.load("updates.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
[Code] .....

Here's what the error is:
**Warning** Symbol=text, layer=actions,
frame=1:Line 2: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
loadText = new loadVars();
Total ActionScript Errors: 1
Reported Errors: 1

View 14 Replies

ActionScript 3.0 :: Loading A Swf Created Using Document Class Gives Error #1009

Aug 29, 2007

Well the shiny new app is now 830K and needs to be preloaded. Simple eh? I've got a preloader that works nicely but I've been trying all day to find a reasonable way to load a swf that was compiled as a document class. My solution was to make a bare bones swf that would preload my main app swf:

[Code]....

View 6 Replies

ActionScript 3.0 :: Loading Blank SWF With Document Class - Stage Is Null

Apr 22, 2009

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at QuizApp/createStatusBox()
at QuizApp()

That's the error message I get when it tries to play. What I have is an swf that loads another when its done, the new swf is blank but has a document class to an AS file. It seems the problem lies when a function is not properly being added to the stage.

The function is added like this..
Code:
package{
public class QuizApp extends Sprite{
public function QuizApp(){
createButtons();
private function createButtons() {
if (this.stage == null) {
trace("STAGE IS NULL!!!");
} var yPosition:Number;
addEventListener(Event.ADDED_TO_STAGE, addedToStage);
...

View 5 Replies

ActionScript 3.0 :: Accessing A MovieClip From An External File That Is Not The Document Class?

Apr 17, 2009

Instead of posting my entire files and such, I'll make a brief example of my situation and my desired outcome.My files consist of my document class entitled Engine.as and another class Abilities.as all within the same folder.On my stage I have a MovieClip with the instance name of item1_mc. On its personal timeline I have 2 frames, one entitled "inactive" and the other "active". Here's a sample of very similar code....

Code:
package
{
import flash.display.MovieClip;

[code]....

How do I access item1_mc? In reality I have 6 different clips and I desire to access much more than frame changes...what's the overall best way to be able to interact with an item placed on the stage via an external .as file that is not the document class?

View 11 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 :: Reference Main Document Class From Document Class Of Loaded Swf

May 7, 2011

I have a FLA (say Main.FLA) document class with a child MovieClip on the stage: into the child MovieClip I load other swf files: each of the files contains its own Document Class (every swf is a somewhat independent application, say quizzes and so on).For some reason I must use the Main document class to store data (scores or so) from the child swfs loaded into the Main swf. HOW do I reference the Main class? I can't find a way.[code]and dispatch an Event this way from the loaded swf document class to the Main class:[code]Now, first of all I don't know if this could even work. Secondly, I tried to make it work by adding an event listener to my Main class but id did not work.

View 9 Replies

Data Integration :: Loading XML Using A Custom Class And Accessing It From Other Classes?

Aug 30, 2006

I began with a class for a movie clip rollover function FigureRollOver. It works marvellously. Three things happen:

1) it loads XML from a file "mod1_fig1.xml" and uses another class, XMLMember, to retool the scoping of the XML so that I can get at it

2) an onload call inside of XMLMember calls the myOnLoad function and transfers the XML into an array.

3) so long as the array is finished building, rolling over a movie clip attaches a new movie clip with the rollover text in it.But I don't want all those functions in one because I need it to be more dynamic, starting with being able to load any old xml file instead of just "mod1_fig1.xml", plus it seems lik overbuilding to have all of that in one class, so I've separated out the loading of the XML and building of the array into its own class, FigureXMLLoader. FigureRollOver is then left to just attach the rollover with text in it, extracted from the array built by the new class.

Problem is, though the array builds inside FigureXMLLoader, I can't figure out how to make it available outside the class. I know that I'm constructing things in the wrong order, and that the array needs to be somehow built inside the class function to be available, but I can't figure out how to do that. A cruddy work-around is to put a function call at the end of the building of the array, which calls yet ANOTHER function on the main timeline of my .swf to put the array I've just built into a new variable.This works, but it's messy. It seems like I should be able to have one line of script in the .swf that generates an array on the main timeline (or just a public array) which I can then access from my FigureRollOver class:

var myRollOvers:Array = new FigureXMLLoader("mod1_fig1.xml");

Here is FigureXMLLoader (see comments in the code for more details) which obviously does not return an array as it is, because of all the working around I've had to do. Note the "testing" variable, which can be traced from the main timeline of the .swf, but I will get "not what I want" because of course the array hasn't been built yet, and never will be, inside of the declaration as it is. How do I get it in there so I can return an array?

View 2 Replies

Professional :: Loading External Swfs Extending From Classes In The Same Shared Codebase?

Jul 25, 2011

I'm currently developing a game in flash and want to be able to divide up my .fla assets in a way that means artists can work on a game menu .fla in isolation from the game.fla and rest of the game code.If I could briefly explain how I've approached this so far, I would be extremelyMy project is setup like this:HighScoreMenu.fla -> document class HighScoreMenu extending GameMenu class.game.fla ->document class game.asgame.as class loads the published HighScoreMenu.swf and manipulates the menu i.e. animates on and off screen via inherited functions in the GameMenu class.

Now this seemed to work to begin with, until my code evolved and upon going to publish my HighScoreMenu.fla flash started complaining about symbols being used in Game.as that were in Game.fla... If I'm only publishing the HighScoreMenu which extends from GameMenu then why is it even looking to compile Game.as

View 4 Replies

ActionScript 2.0 :: Loading External Files Onto Movie Clip Derived Classes?

Oct 28, 2009

I'm attempting to use the movieClipLoader to load a file onto an instance of a class derived from movieclip. For some reason, this doesn't seem to work, because after it successfully loads, the array that contains these derived class instances suddenly become movie clips and lose all their derived variables (tracing them resutls in 'undefined').So I thought there must be another way. Perhaps there is a way to copy the image data from one movie clip to another, or someone suggested taking a snap shot of the first movie clip and then applying it to the second as a bitmap.

View 1 Replies

ActionScript 3.0 :: Moving Document Class .fla Cannot Find The Document Class - WTF?

Sep 22, 2008

So I had a working .fla, with a document class package in the same directory. Everything was fine, until moving both to a new directory, now the fla cannot find the document class. WTF?

View 2 Replies

ActionScript 3.0 :: Loading External Swf Which Attached With Its Own External Class?

Jun 27, 2009

Lets say I have Main.swf and sub.swf, and I wanna load sub when I press a button from Main, but sub.swf has its own external class file attached, so here is the problem, when I load sub using loader class and I would get this message from the output panel:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at subScript()

seems loader class can not access sub.swf's external class when sub is being loaded.

View 1 Replies

ActionScript 3.0 :: Import Other Classes Into Main Class Or Extend Other Classes To Main Class?

Aug 1, 2011

how to get a Class file up and going in Flash and that works fine but say I want to import other classes. I try "import testCass" above in my import statements section of my as file and that doesn't work. What do I have to do to get that to work?

View 6 Replies

Actionscript 3.0 :: Preload The .swf Itself Using Document Classes?

Mar 24, 2009

I'm trying to go from inline scripting to document class, and having a very hard time going there..! at the moment I'm trying to preload my flash/swf'en, when loading it in html.

I've managed to do it inline style,check out an example here

this flash has 2 layers, a script layer and a content layer. each layer has 2 frames. in the first layer I have this code:

Code: Select allimport IndexPreloader;   
var _indexPreloader:IndexPreloader = new IndexPreloader();
setupPreloader();
function setupPreloader():void {

[Code].....

when using this setup, it's as if all the content of the .swf is loaded before the preloaderen is started.. so the preloader has nothing left to preload and starts and stops almost at once.

View 4 Replies

Actionscript 3.0 :: Communicate Between 2 Document Classes?

Aug 31, 2010

I have 2 different swf files with their own separate document classes. My first SWF file is main.swf and it's document class is called Main.as (its the main container that loads in external swfs). The file being loaded into main.swf is called step1.swf and it's document class is called Step1.as. I have a next button in step1.swf that when clicked needs to tell the document class controlling my main.swf (ie Main.as) to load in the next external swf. However I don't know how to call a function in one document class to from another document class. And I don't know if that fact the swf calling the function being loaded into the other makes this situation more complicated. I've looked around but I cant seem to find the answer anywhere. Basically I need these two separate document classes to communicate between one another.

Here is the code for Main.as (the doc class for the container SWF):

Code: Select allpackage
{
import flash.display.*;
import flash.events.*;

[Code].....

how to get swfNavigation() to run from the other class

View 1 Replies







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