ActionScript 3.0 :: Accessing Class From External Swf?
Sep 29, 2010
I have created an SWFloader class that creates a container on the stage and loads an external swf into it. How can I click a hotspot in the external swf and make it instruct the loader class to load a new external swf? Basically, how can I access the SWFloader class from the timeline of the external swf?
View 1 Replies
Similar Posts:
Aug 3, 2009
im still trying to get into the whole oop thing but I still have some things that i dont understand.I have a movieclip on stage that i want to access using an external class that lives in a different folder.Is there a way to access movieclips on stage from external classes or that i have to create a connection between the document class and then send the movieclip instance using a class method ?
View 1 Replies
Jun 11, 2011
I'm new to AS3 and I'm trying to load a data from a XML file ("AppData") and set the data (text) in a dynamic text field("Label") on the stage. For accessing and manipulating the XML file ,I have an external as file with a class called "DataClass". And I running scripts in project frame to access the data from XML in the class "DataClass" to set it in the text field.
View 2 Replies
Feb 5, 2010
When I debug this, it gives me an error saying that it cannot access the stage because it's a null property.
ActionScript Code:
package {
import flash.display.MovieClip;
import flash.display.Stage;
import flash.text.TextField;
import flash.events.Event;
[Code] .....
View 2 Replies
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
Jan 18, 2011
I'm currently working on a game. I'm breaking down each piece of the game into individual classes and movieclips. The intro begins by going to the main menu which is a MC in my fla library. This is called through the document class. then all actions the main menu MC performs are commanded through the MainMenu class. When starting the actual game, MainMenu calls a function from the document class, after it is removed from the stage, that puts an empty movieclip called Level on the stage.
View 2 Replies
Jun 11, 2011
I'm new to AS3 and I'm trying to load a data from a XML file("AppData") and set the data(text) in a dynamic text field("Label") on the stage. For accessing and manipulating the XML file ,I have an external as file with a class called "DataClass". And I running scripts in project frame to access the data from XML in the class "DataClass" to set it in the text field
View 13 Replies
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
Apr 23, 2010
How can I access objects and modify their property that is ALREADY placed on the stage using external classes (AS file)? I 'm a newbie of AS3 and followed some tutorials about AS3 not long ago. For I learned scripting in AS3 can be done using AS file rather than script on Timeline. But I have a question. How can I "find" and "modify"the objects on the stage, or inside a MovieClip , in AS3?
For example, I have a file call Stage004.fla which have no document class linkage. I place the MovieClip "StageMain" which links the Stage004.as on the stage. StageMain has a textfield in it named "textFieldStage001". The Stage004.as is ran using "Event.ADDED_TO_STAGE" since StageMain is on the stage. I create another AS file WindowRename , to test can I modify the text in "textFieldStage001".
Then the famous error #1109 occurred.
"1119: Access of possibly undefined property textFieldStage001 through a reference with static type Class."
ActionScript Code:
package {
import flash.display.Stage;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class Stage004 extends MovieClip{
[Code] .....
View 9 Replies
Jan 25, 2010
I have downloaded an AS 3 class file, designed to create an MD5 hash from a string. I have put the class file in my /components directory (with / being the root of my Flex project source).[code]...
View 2 Replies
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
May 4, 2010
I can reference the main library Class, but the clips nested within are coming up undefined and the usual parent.child.child method of accessing clips using getDefinition isn't working.
Here's my coding:
Code: Select allpackage {
import flash.display.*;
public class Menu extends MovieClip{
[Code]....
I tried both instances naming and Class naming in the library. It loads the clips within the menuClip. I can see them, but I don't have access for some reason.
View 2 Replies
Feb 19, 2010
I realize this is kind of an odd issue, but I am wondering if there's any way to get Flash to allow me to access a class's static functions using a class variable that points to the class. Example:I create a class called FooClass that has a static function named fooI then create a variable of type Class that points to it
Code:
var class:Class = Class(getDefinitionByName("FooClass"));
However, when I try to call foo() using the variable, it errors saying the function
[code].....
View 6 Replies
Jan 6, 2011
I have created a class, call it Class1, that has various objects drawn on the stage (drawn in the IDE). It also has a function, called setColour, for changing the colour of those objects. The function works fine if I call it from within Class1.
Now I have another class, call it testClass1, that imports Class1 and calls the setColour function. First of all, none of the stage objects from Class1 are visible. Secondly, when setColour tries to modify the colour of an object, I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
This is the code for testClass1:
ActionScript Code:
package
{
import flash.display.*;
[Code].....
So, what is the problem? Is it possible to change objects that are drawn on the stage of an imported class?
View 3 Replies
Mar 14, 2011
I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem to be working for me.[code]
View 1 Replies
Mar 14, 2011
I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem to be working for me
package jab.enemy
{
import flash.display.MovieClip;
[code].....
View 1 Replies
Jun 9, 2011
I have a class, call it MyClass, and there are several variables that I need to be able to access each instance of from within the class.So for instance, I need the object myObject1, a member of MyClass, to store the variable myNumber.From the main timeline, if I trace myObject1.myNumber, I get whatever number I've stored.
However, I need to check the numbers against another parameter, so I need to be able to test if myObject.myNumber == myOtherNumber. But from within the class, if I trace this.myNumber or myNumber I get null.What is the proper syntax for accessing a variable within a class?
View 5 Replies
Jun 12, 2011
I can't find a way to directly access a MC (or textfield, etc) on the timeline from a Class loaded into my Document Class. No problem from the Doc Class, but can't do it directly from the loaded Class. Is there a trick to essentiall extend the Doc Class AS from another external class?
View 7 Replies
Jul 3, 2009
I'm being really dumb today and I know this should be simple.....How do i access the stage from a class which isn't the Document Class? For instance, I want to create a tween which takes in the parameters of the stage's width? So I've written.....
ActionScript Code:
var myTweenX:Tween = new Tween(this, "x", Regular.easeOut, this.x, stage.stageWidth, 60, true);
[code].....
View 4 Replies
Mar 11, 2009
I have an array in my doc class that I'd like to access from an external class. Can you do this and if so what's the syntax?
View 6 Replies
Sep 3, 2009
I have a document class that looks like this:
Code:
package
{
import Map;
[Code]....
Is it possible to access a property of the Map class (though map defined in the Document class) from within the hero class?
View 4 Replies
Feb 28, 2010
The Main.as file will have all of the game logic, such as the mysteryNumber.
The other actionScript files represent rooms that the user may click and depending on the 'mysteryNumber', it will execute the 1 of 6 scenarios.
So for example, if a user clicks the Library page, the LibPage.as will call the 'mysteryNumber' and execute some code to display on the library page.
It will be the same for the other 4 rooms.
The problem I have is that the LibPage.as won't call the 'theNumber' property from Main.as
Here's the Main.as
Code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code]....
View 3 Replies
Oct 6, 2010
I'm trying to do this,
Code:
Main.instance.subClassFunction();
instance is a public static variable on the default class, Main. I can do Main.instance.defaultClassFunction() with no problems at all, I use it to access functions and variables from within other classes. Is it possible to use this method to call a function on the subclass, currently I have to do this,
[Code]...
View 4 Replies
Oct 12, 2011
I'm pretty new to fully using class's for my programming (in-frame scripting satisfied me for a while). I am having a problem accessing the properties of a class from another class. The first class (I'll call it controller) receives a reference to an object of another class (I'll call it display). Display have several specialized subclass (I'll call one SequencedDisplay). SequencedDisplay has a timer in it that I need to access:
[Code]...
View 2 Replies
Jul 3, 2009
How do i access the stage from a class which isn't the Document Class? For instance, I want to create a tween which takes in the parameters of the stage's width?[code]
View 8 Replies
May 25, 2010
I have created a movieclip in the library and added a class to it. I want to access a function and set an Array in that class from the document class...Heres what im doing now which is not working... it says startnow function is undefined.
PHP Code:
package comimport flash.display.*; import flash.events.*; import com.NavMC public class Capability extends MovieClip Constants: //
[code].....
View 5 Replies
Jul 21, 2010
would it be possible to access a variable name containing a class from the class itself?
Example:
Code:
var __NAME__ = new TestClass();
package com.Test
{
[Code]...
View 14 Replies
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
Oct 23, 2009
I'm trying to write a class that somehow emulates the old AS2 gotoAndPlay(); function, but i'm failing to find a way to reference the timeline that is calling the Class Constructor.
this is what i am using to call the class, i'm placing this code in the frame of the timeline i want to control. but it always gives me a null error.
I Know senocular adressed the timeline issues in one of this forum's post, but i can't figure out what to do in order to register this class in the specific timeline in order to control it.
the frame goes like this:
[Code]....
View 3 Replies
May 2, 2009
why can i access the first function in a class with
PHP Code:
import test.test
var test:test = new test();
but I cannot access the second or third function in the same manner? they seem to be seperte entities within the class definition.
can access
PHP Code:
public class NetStreamex {
public var connection:NetConnections = new NetConnections();
public function NetStreamex():void {
connection.createNetConnection("rtmp://localhost/test/1");
[Code].....
View 9 Replies