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


Similar Posts:


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 :: Access Main Time Line From Class?

Feb 12, 2009

document class

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

[Code].....

the highlighted function is what i need to be working but it isnt.. have no idea whats going on... i basically need to jump between frames on the root timeline (superMain)

View 1 Replies

ActionScript 3.0 :: Class Access A Variable On A MovieClip's Time Line?

Oct 2, 2009

in my class I declare a linked movie clip:

a_mc = new LinkedMC ();
trace(a_mc.testString);

and on the time line of LinkedMC: var testString = "test string"; but I can't access testString.

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

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

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.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 :: 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 A Movieclip On Document Class From Another Class?

Mar 3, 2011

Going further on my app, I felt in another problem. Despite having lots of posts on the web regarding this, none of the solutions worked for me In my document class (Main.as) ve two containers. One empty and another with a star that is being imported from the library. Here´s the main class:

package
{
import flash.display.*;

[code]......

View 4 Replies

ActionScript 3.0 :: Access A Var From The Main Time Line In To A Movieclip?

May 19, 2009

I'm making a quiz-type animation, since I'm new with ActionScript I had developed my own way to make this work. I want to add like a meter that shows one out three position depending on the answer given, I had made this animation as a movieclip but now I need it to react according to the answer, so it changes on every question to do that I need to access the variables I'm using in the main time line, how can I access the the main time line variables from the movie clip? The movie clip (meter) is basically the background and the questions will change and advance on top of that movie clip so it'll change with each answer until you get the final result.

View 12 Replies

ActionScript 3.0 :: Access The Slider Class Properties?

Sep 18, 2010

I'm new to as3 and I was trying to make my own slider for a while until I found the slider component.  The slider component is so perfect for what I want to accomplish. But the size of the little graphics is ridiculous.  If you click on the line that the slider knob is on top of the knob will snap to where you click.  This is great but with only 3 pixels of height to click on it's pretty much useless.  I tried going into the slider movie clip and altering the individual graphics but when I run the program the sizes are back to their teenie tiny size.

View 1 Replies

CS4 Non-document Class Can't Access Library

Jan 27, 2010

Got two classes "Engine.as" and "Player.as". Engine.as is the document class that is calling Player.as.

The point is to have Player.as create a movieclip on the stage, but it seems it cannot access the library or something. Because when the player class is at the createHero() method it gives me the "error 1009 cannot access a property or method of a null object reference"

Engine class:

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

[Code]....

View 2 Replies

ActionScript 3.0 :: Access FileReference Class Add On Properties And Methods Of CS4 In CS3?

Apr 7, 2009

I have an urgent task to implement in my project code. I can't able to access the new properties and methods which are present in FileReference Class. For load() ,save() methods needs runtime version of Flash Player 10. I need to include the flash player 10 in CS3 publish settings Version. Otherwise you can suggest how i can able to access the FileReference class new properties and methods without CS4.

View 7 Replies

ActionScript 3.0 :: Access Properties Of Objects That Are A Member Of A Class

Mar 20, 2009

I have created a class, that is simply a group of text fields. In the main app, I create instances of this class, and add them to the main app. How can i access the textFields that are in the class, to say, change the text, etc... When I try, I get this: 1119: Access of possibly undefined property txtHeadLine through a reference with static type Article.

View 3 Replies

ActionScript 3 :: How To Access Stage Properties In Custom Class

Jul 26, 2009

How do I access Stage Class properties in Custom Class?
Class:
package {
import Main;
import flash.events.*;
import flash.display.Sprite;
import flash.display.Stage;
public class Run extends Sprite {
[Code] ....

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

View 3 Replies

ActionScript 3.0 :: Access MovieClip Properties From Inside A Class?

Jul 18, 2009

Is it possible to access properties from a movieclip on the stage from a class attached to another movieclip?[code]...

View 1 Replies

ActionScript 3.0 :: Access The Properties (x, Y, Direction) Of An Onstage Mc From Class?

Mar 24, 2011

I'm working on tweaking a very basic 2D platformer that has the following classes:

PlatformGame.as (goes with PlatformGame.fla)
HeroArm.as
PointBurst.as (not really addressed at all in this issue)

The PlatformGame code defines the hero with this code:

[Code]...

What I'm trying to do is attach the HeroArm movie clip to the hero movie clip, but I can't access the x, y and direction of the hero from the PlatformGame class, I guess because I simply don't know how. I know that at some point in HeroArm.as, I need to do something like:[URL]...

View 1 Replies

ActionScript 3.0 :: Access Object Properties In Class File?

May 27, 2011

I made a movie clip that is linked to a class named "Fugel". In the "Fugel" class I want to access the object's properties (x, y, rotation, alpha...) that I created in the main FLA file. I'm trying to center it in the constructor, but I don't know how to. The "this" keyword doesn't seem to work.

Here is the code for the "Fugel" class:

Code:
package {
import flash.display.MovieClip;
public class Fugel extends MovieClip {
public function Fugel() {

[Code].....

View 5 Replies

ActionScript 3.0 :: Access Properties Of A MovieClip Inside A Class?

Apr 11, 2012

I want to turn my previous background in a platform game with his alpha as 0, so i tried this[code]...

View 14 Replies

ActionScript 3.0 :: Access File Class From Document?

Oct 3, 2011

It seems simple, but it doesn't seem to be working I have 2 as3 files as classes "mainclass.as3 (this is the document class)" and GamePlay.as3

the GamePlay class works flawlessly on it's own, but when i try to create the var to access it ... var gp:GamePlay=new GamePlay(); ... i get the following error.

I have looked at tutorial etc, but i cant get it to work i am currently getting the following error.[code]...

View 1 Replies

ActionScript 3.0 :: Access A Mc Or Textfeild From A Non Document Class?

Sep 21, 2010

It used to be simple to access an object you put on the stage like a mc or dynamic text field by simply using _root.instanceName ect.  Now I see references to making references to the Stage and such like:
 
private var stage:Stage;
stage = stageRef; 
and I am still confused.
 
What I have going on is, I have placed a movieclip on the stage in Flash and gave it an instance name of Cell_mc.I have a cusom class that extends MovieClip with the following imports

import flash.display.MovieClip;
import flash.events.Event;
import flash.events.EventDispatcher;

[code]....
 
This Class is tied to a set of MovieClips in my Library.

I have a listener: this.addEventListener(MouseEvent.MOUSE_DOWN,pickUp);
 
And a function:

private function pickUp(event:MouseEvent):void
{
this.startDrag();

[code]....
 
I get the following error whenever I try to access an object I placed on the stage from anywhere other than the document class:
 
1120: Access of undefined property Cell_mc.
 
How do I access the cell_mc that is already on the stage from this non-document class?

View 5 Replies

ActionScript 3.0 :: Access Some Vars From A Document Class?

Sep 30, 2009

if i want from a document class to access some variables in other classes (which are imported into that document class) does these variables need to be public to access them or they can be something else?

View 9 Replies

ActionScript 3.0 :: Access The Timeline From Document Class?

Nov 14, 2010

How do I access the timeline from the document class? I tried: trace(this.parent as MovieClip)

but I got a null object.

View 9 Replies

ActionScript 3.0 :: Access Document Class From Within Movieclip?

Jan 30, 2009

I was wondering if it was possible to access the document class from within a movieclip.

I am creating a slideshow type project, and I'm using a document class to switch between the frames using the arrow keys. However, in one of the "slideshow screen" movieclips, I want to have it stop, and then play another part when the arrow key is pressed again.

I tried to access my nextScreenToPlay method within the document class, but whenever I try to do it within a movie clip, I get this error: Call to a possibly undefined method nextScreenToPlay through a reference with static type class.

If I do a trace(Main), within a movieclip, it shows the class.

View 1 Replies

ActionScript 3.0 :: Access Document Class Var From Movieclip?

Sep 18, 2009

trace(MovieClip(root).TRACE);

so at pesent I am using this to try and access

Code:
public var TRACE:String

in the the document class.

however I am getting this

"1180: Call to a possibly undefined method addFrameScript.�"

my document class extends to Sprite as I have some stage resizing that occurs on Initialise

Code:
StaticInheritance extends Sprite

Im sure it has something to do with the way the document class extends.

View 1 Replies

ActionScript 3.0 :: Access Modifiers In Document Class

Jun 15, 2010

I tend to give my Document class all public access modifiers. Would there be any reasons not to do this?

View 3 Replies

ActionScript 3.0 :: Can't Have Access To Stage In Document Class

Aug 30, 2010

Just tried using cs5 on my new macbook and I have a tlf text object on the stage with an instance name of mText. I tried to access (mText.text = "test") it like this and got a null object reference. I tried to trace the stage from my document class and it was null when the tlftextbox was on the stage but i could trace stage correctly when I deleted the textbox. [code]...

View 2 Replies

ActionScript 3.0 :: Unable To Access The Public Properties Of Custom Class

Nov 28, 2008

i wonder why i am unable to access the public properties of this custom class the public var w:Number; and the Public var h:Number; i am tracing them and on an instance of the PreLoader() Class.. and ia m getting NAN;

View 12 Replies







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