ActionScript 3.0 :: Accessing Properties Of The Document Class?

Nov 14, 2009

when I try to access a property of the document class from another class, I get an error:

Quote:

1119: Access of possibly undefined property _left through a reference with static type flash.displayisplayObject.

Maybe I'm not doing it correctly? This is how I've been accessing document class properties so far. Does the fact that they're private make a difference?

Quote:

root.property

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Document Class, And Accessing Properties?

May 25, 2009

I'm currently working on an interactive app, (site) which requires me to modify a few textfields, and change images dependant on the user choice (using mouseevent). This is a separate module, thus I'm posting the question in here instead:there are three images, that are lined up, with a textbox next to them. When a image is chosen, and enlarges, the text changes with the chosen image, according to XML.The textFields, 'text_title', 'text_description' are contained in a movieclip, called 'textbox'.This has been built in the Flash IDE (CS3) named info.fla/swf, which refers to a Document class 'com.info', made in Flex Builder 3...I attempted to modify the textfields using this:textbox.txt_title.text = "Loading";textbox.txt_desc.text = "test";But, I was unable to at first to change the text using the document class, as it gives "1120: Access of undefined property <variable>".

View 3 Replies

Actionscript 3 :: Stage Properties In Custom Class, Not Document Class?

Oct 14, 2011

I need to use stage.width/height in my CustomClass so I found some topics about it.

if (stage)
{
init(ar,firma,kontakt,oferta,naglowek,tekst,dane);

[code]......

View 1 Replies

ActionScript 3.0 :: Accessing Properties Of A Member Of A Class From Within The Class?

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

ActionScript 3.0 :: Inheritance - Accessing The Properties Of A Class From Another Class

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

Professional :: Document Class X / Y Properties?

May 7, 2010

I've been working on a project in Flash CS3 for a while.  To follow an object on the screen and keep it centered, I'd adjust the Document Class' x and y properties.
 
Yesterday I bought/installed Flash CS5 and thus Flash Player 10 was also installed.  Now when I go play my SWF it seems everything is all buggy, as if the code that modifies the Document Class' x and y properties isn't exactly working properly...

I've since reopened the CS3 FLA in CS5 and converted it to a CS5 format and I can't seem to get it working the way it used to.

Did something change regarding the Document Class and how to modify the x / y properties of it in the Flash Player 10 version?  I really don't know what's going on at this point.

View 4 Replies

ActionScript 3.0 :: Accessing The Stage From A Class Which Isn't The Document Class?

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

ActionScript 3.0 :: Accessing Variable In Document Class From Within Another Class?

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

ActionScript 3.0 :: Accessing A Class Property Through Document Class?

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

ActionScript 3.0 :: Accessing Document Class Property From Another Class

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

ActionScript 3.0 :: Accessing Another Class's Properties From A Different One?

Jul 1, 2009

I have two movie clips on the stage at frame 1 and frame 2. Both are instances of seperate classes. (They are not dynamically created, just their linkage is set to their class names)I have created soundChannel and Sound Objects in Class 1 and I want to access them from Class 2. (I want to stop the sound channel that was started in class 1)Is there any way to do this? If yes, will this be true for other properties also?

View 7 Replies

Accessing Stage From A Class Which Isn't The Document Class?

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

ActionScript 3.0 :: Accessing MC Class From Document Class?

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

ActionScript 3.0 :: Accessing Properties Of The Stage From A Class?

Aug 29, 2009

I am trying to access the x and y properties of the stage so I can set an objects' x and y properties to place it on the center of the stage:

this.x=stage.stageWidth/2;
this.y=stage.stageHeight/2;
The call to instantiate the object(*.fla):

[code]......

View 4 Replies

ActionScript 3.0 :: Accessing Properties From Stage In A Class?

Feb 28, 2012

I am trying to access a property that belongs to the stage, from a class. For example, let's say I add a textfield with an instance name of "magic_txt" on the stage. In the Document Class, I am able to access magic_txt and update the field like so:

magic_txt.text = "Magic Text"

However, since I would like to work in classes, I am having a difficult time figuring out how to access the property "magic_txt.text" from a class. I know I need a reference, but I am unsure how to set this reference.

I am coming from a strong background in Visual Basic, and in Visual Basic, the way to access a form property is to call the form name (dot) object. In actionscript, it doesn't seem to be as simple.

View 9 Replies

Actionscript 3 :: Access The Document Class' Properties From The Time Line?

Feb 28, 2010

I am building your standard slideshow flash header for a web page.

There are three main parts:

The Slideshow class A controller class that is used as the projects Document Class Some linking timeline code.

The slideshow class has all the functionality, so I used the Document class to create a new instance of the slideshow and keep a property variable called slideshow that keeps a reference the Slideshow instance.

import flash.display.MovieClip;
import flash.events.Event;
public class Header extends MovieClip
{

[Code].....

Despite me being able to call regular methods that are in the Doc Class from the timeline, I can not call properties without the following error, for example when i say slideshow.play():

1061: Call to a possibly undefined method play through a reference with static type com.example.test:Slideshow.

I have to make a method on my document class every time I want to wire an event to call an object in my Document Class?

View 1 Replies

ActionScript 3.0 :: Accessing Instance Of Document Class

Jun 5, 2009

I have a really peculiar problem that relates to the old question of how to best access the instance of the document class from a different class. I usually add a 'this' as parameter when I create an instance of another class inside the document class. Then I save this 'this' in a class property of the type 'Object'. It usually works just fine but lately I have encountered a really bizzarr error.

When my movie first starts I have to load 2 xml-Files. I do that in another class - that calls upon the document class instance when it is finished. I use 4 methods for that, each calling the other, when it is finished.
(like one doing loader.load(urlRequest),
then loader.addEventListener
(Event.Complete, nexthandler) and so on

Now, when I call back to my document class from the last of these 4 methods it works just fine. But when I try skipping the first two methods (since I now need only one xml-File) - my try/catch-statement suddenly complains: TypeError: Error #1010! Like it needed more time to establish the instance of the document class or something similar strange.

View 4 Replies

Accessing A Stage Instance From A Class Other The Document?

Dec 19, 2010

I have a main document class with another class instanciated (mouse follower.as) within it. I want the mouse follower class to access a stage instance. How is this done?

View 1 Replies

ActionScript 3.0 :: Accessing Function In The Document Class?

Nov 24, 2009

I have an instructions.as file which is trying to call a function in the document class through a mouse click event listener and am getting a 1009 error.

Here are my to actionscript files:

** this the the instructions.as**
package Elements{
import flash.display.MovieClip;
import flash.events.*;

[Code].....

View 3 Replies

ActionScript 3.0 :: Accessing A Function Of The Document Class?

Mar 29, 2011

My project is structured as following :

- a fla file with movieClips on the timeline , this fla is linked to the Main class

- a Main class who does some randomization of the animations

- a MenuItem class which function is to give each button menu the same functionnality

the problem is that I'm trying to access to the randomNumber function inside the Main class from the MenuItem class to prevent the rewriting of the function inside this class. I've made some research on Google and apparently I have to create a Singleton class so I can access the Main class from everywhere, I've followed those instructions but it still doesn't work, when I trace the Main class from the MenuItem class it gives me a Null result!Main Class code :

Code:
package
{
import flash.events.Event;[code].....

View 4 Replies

ActionScript 2.0 :: Accessing (Nested) Component Properties From Class

Jul 29, 2009

(Actionscript 2 btw - and actually cs4, not that it really makes any difference?) I have a class that instantiates a movieclip from the library, e.g.:
Code:
debugbar:MovieClip = thing.AttachMovie("debugbar", "debugbar_mc", 999);
So attaching it to the where ever "thing" is - could be movie clip or level0 or whatever, doesn't matter as "debugbar" is a private variable of the class. Now the important part - debugbar in the library is a movieclip that contains some components - buttons and textInputs. The problem comes when trying to access these components.

I would have thought that this would work:
Code:
debugbar.input_txt.text = "hello";
In order to set the text of "input_txt", the instance name of a TextInput component on the timeline of the movie clip (put there in author time). However, this does not work. Infact, I cannot access any specific "component" properties - they come back undefined. I can however set and retrieve MovieClip properties for the "input_txt", such as _x. However there is one added strange thing with this too - setting _visible to false doesn't seem to work (however perhaps a component by default overrides this).

I also appear not to be able to add event handlers to the component - at least for the usual component events. I tried casting it to a component, such as:
Code:
var temp:TextInput = TextInput(debugbar.input_txt);
trace(temp);
which gave "temp" as null.
However if you trace the thing itself without casting to what it is, it gives the path to correctly. It almost seems like the components are somehow broken when trying to access them this way - or that they cannot be accessed this way?

The thing is, I was able to access all of this before, when the code to do it was placed on the timeline (frame 1, the only frame) of the debugbar itself, where the components were child instances. This meant I could just reference them directly too - so input_txt rather than debugbar.input_txt , although that is probably largely irrelevant. I need to have it in a class though, as I need to pass in certain objects that need to be accessed by the mc.

View 2 Replies

ActionScript 3.0 :: Flash Unable To Access Properties Of A Movieclip From Document Class?

Aug 24, 2011

I am developing a Jigsaw puzzle in Flash. I am developing a class for puzzle piece. The code of the PuzzlePiece class in given as follows.

package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;[code]....

I will be choosing which mask to use based on users selection of puzzle piece.When I try to use traingular mask by adding puzzle.gotoAndStop(2) the swf just flickers. Thought the holder_mc and mask_mc are exactly of same dimension one comes below lower than other though I have not altered the position of the clips within a puzzle piece.If you want to take a look at my fla here it is https:[url]....How to go to a specific frame 2. Why is position of two clips inside the piece changing

View 1 Replies

ActionScript 3.0 :: Setting Properties Of Nested Clip From Document Class Of Parent

Aug 29, 2011

Setting properties of a nested clip from the associated document class of the parent clip. I am developing a Jigsaw puzzle in Flash. I am developing a class for puzzle piece. The code of the PuzzlePiece class in given as follows.

PuzzlePiece class
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class PuzzlePiece extends MovieClip {
private var pieceX:Number;
[Code] .....

Is it wrong to access it like that. The PuzzlePiece is the export for a puzzle clip. For the time being I am hard coding the dimension as 60. I have aloso uploaded the fla and as files. [URL].

View 4 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

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 Document Class Function Within Timeline

Oct 10, 2010

have a very simple question, (Bear with me I'm still quite new to as3 and some of my terminology may not be solid) I want to access a function that is within my document class when a movie clip on the timeline has played to a specific point (being the end). I have already been able to call another function from the document class at the top/root level (it is called to initialize all clips and buttons when you click on the "enter" button on the splash screen. Problem is that I cannot call another function (in the document class) from a movie clip within a movie clip on the timeline. Is there an easy way to do this? I have considered writing a separate class for the movie clip and then adding it onto the movie clip (using the property panel). I don't really want to do it this way because I am already using a base class on that movie clip and 3 others that use a set of generic functions.

View 1 Replies

Flash :: Accessing A Variable Declared In Fla From Document Class?

May 24, 2011

On the stage I have a movieclip by the name of rect_mc. Inside it have have a MovieClip square_mc.In the time line that I get when I double click on rect_mc (timeline of rect_mc) I have written the following code

var width1:Number;
width1 = sqaure_mc.width;

How can I access width1 from the document class?The thing that I want to is access the variable declared (width1) in the timeline of rect_mc. Just for the sake of a example only I choose the width of MovieClip.My doubt is how can access a variable declared inside the timeline of rect_mc from the document class. It could be any variable.My document class is:

package
{
import flash.display.MovieClip[code]....

View 1 Replies

Flash :: Sending Variable From Fla To Document Class And Then Accessing?

May 31, 2011

I want to find out whether my swf was loaded locally or from another swf. For this purpose I have declared a variable 'parentType' in my fla. var parentType:String = String(parent); There is a function in the document class that determines whether swf was loaded locally or from another swf. The name of the function in the document class is 'externalOrInternal'. The varaible parentType is passed as a parameter to the function externalOrInternal externalOrInternal(parentType); The name of the document class is Main. In the constructor of Main I have the function pollResize() (the use of this function is to listen for the resizing event. That part of the code is not shown in the snippet given below).

[Code]...

I see that swfParentType is has value insde the function externalOrInternal. My doubt is why null is traced inside the function pollResize. Why is it not [object Stage] as inside externalOrInternal. Due to this I am not able proceed further with the stage resizing event.What needs to be done so that proper value is traced in the function pollResize.

View 1 Replies

ActionScript 3 :: Accessing All Instances Placed In Different Frames From Document Class?

Aug 11, 2011

I have programmed a game using the Flash authoring tool and a document class. I'm trying to graphically add instances and add functionality in the document class. Suppose I have a main timeline with 3 frames, each frame reperesents a different level of the game. In frame 1 I have an instance of the MovieClip class named tree1 on the stage and in frame 3 I have an instance of the MovieClip class named tree3 on the stage. In my document class, after an initial stop() command, I want some logic like:
tree3.scaleX = tree1.scaleX;
But tree3 is unknown to the runtime since we are not of frame 3 yet. Any way to access all the instances on all frames declared in the authoring tool from the document class?

View 1 Replies

ActionScript 3.0 :: Accessing A Method In A Class Document From The Timeline?

Apr 11, 2010

I have built a button in the fla timeline and need to have it fire a method in a document called gigyaSocial. the Timeline code works fine but I cant get it to recognise the method that I commented out at the bottom if this code snipit.

ActionScript Code:
import fl.controls.Button;
import com.player;
import com.gigyaSocial;

[Code]......

View 9 Replies







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