ActionScript 3.0 :: Don't Get How To Have A Class Ref Timeline?
Dec 31, 2008
If I load a class on my root timeline and I have a movie clip call "ball_mc" on the root timeline. How do I make a function in the class control that movieclip? I don't like the addchild because I design my pages and then animate them. If I'm inside the movie clip using actions trying to reference a main timeline item I use MovieClip(root).instanceName.This works perfect, however it doesn't work in a class.
I would use classes if they were easy to reference objects on the main timeline...
I would like to store the value from combobox or text area-MovieClip in MyClass and then I'd like to read this from another frame in *.fla file only this :) have you another code? what can I write in frame 2 Miclass and frame 3
Is there a way to link to a class file from the timeline rather than using the Document Class? (I tried using the document class but it messed up because of the nested movie clips and stuff like that... so I need another way)
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?
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.
how to reference a variable that is on my main timeline into a class.Or I need to know how to pick up a variable from my php file (as in "myswf.swf?variable=3") into my class.This was all very easy to do in AS2.I just can't find out how to do it in AS3.
I have a class that controls an enemy. From within that class, it checks for collisions with an array on the main timeline. I've done it this way before and it works fine, so I have no idea what I've done wrong this time. It keeps giving me an
I can import other classes to the timeline and use them just fine, but this class is giving me major problems? I am parsing XML data from my server on it and it is giving me errors that look like this.
The timeline reference and usage: import networkScores; var network:networkScores = new networkScores(); addChild(network); score1Textfield.text = network.score1.toString(); [Code] .....
The errors I am getting: Scene 1, Layer 'Actions', Frame 4, Line 149 1119: Access of possibly undefined property score1 through a reference with static type networkScores. 1067: Implicit coercion of a value of type networkScores to an unrelated type flash.display:DisplayObject.
I have a MC1 with a class that controls it on my timeline. Within this MC there is a second MC2 which contains a short animation. During that animation i need a trigger that will call a method from the class attached to the main MC. MC1 is linked to CLASSMC1 contains MC2(short animation)MC2 calls a function in CLASS
I have a multidimensional array on the main timeline. Its name is myInst. I need to access this array from this class to build a scrolling list of swfs which the path to the swfs is in the myInst array. I have not included the entire code/class because the issue is somewhere in this part. The error is 1009, cannot access a property or method of a null object reference. This fla is not going to be the root fla, it is going to be external, so the use of root probably will not work, but I tried it anyway, to no avail.. for any help.
I need to assign dynamically a path to a xml file through Flashvars. How I can make it work? I was able to get Flashvar from html page into swf with actionscript code on timeline:
1. HTML � assigning Flashvars with swfObject:
Code:
<script type="text/javascript"> var flashvars = {}; flashvars.xmlfile = "xml/data.xml";
When I set the following class as my document class it works (draws a rectangle) but when I don't set it as my document class and instead instantiate it using var myRec:simple_shape = new simple_shape(); in first frame of my timeline nothing happens no rectangle and no error either). why and how I can get it to work without setting it as my document class?
I've been working on flash CS3 for some time now and have learnt a lot in actionscript 3. However, I still have some very simple doubts which I want to clear:
1) Is the Document Class same as the Main Timeline? 2) If we type "trace(this)" in the actions panel on the main Timeline, it gives "object MainTimeline", is this what is the document class because there is nothing else as the mainTimeline Class. 3) If we type "stop()" in the main timeline, it stops the movie. Where does stop() belong, I mean, it is the method of which class? 4) Sometimes, when within a class or a movie clip, something like "root.gotoAndPlay" doesn't work while "MovieClip(root).gotoAndPlay()" works. Another example is when we try accessing a child of a movieClip by using getChildAt(i), "MC1.getchildAt(i).play()" does not work and we have to write "MovieClip(MC1.getchildAt(i)).play();
I am trying to make a basic timeline for a class but I can't figure out the coding to use. I have worked on an older version- macromedia flash but I can't get cs4 to work for me.What I am trying to do is have a button that is the date. When someone clicks on it or rolls over it information about that date is highlighted. I want the box with the text to turn from grey to white then back.I can make the button and get that to work but I can't seem to get in further on it. Meaning that once I try to connect it to the box with the text everything starts to go crazy.
I wanted the animation to not roll back once i click on a certain button and i wanted the animation to go back once i click on a different button. My question is, how do i proceed from here, i searched online for clues and from what i understood i could set variables within the class and change them on the timeline and use event listeners to catch the changes. I tried doing that but i always end up with some redundant way that gets me nowhere...
I have an array in a timeline that I need to pass to a class file, but I can't seem to figure out how to do this, as the method of inter-class array transfers doesn't seem to work.
I have a air for android project going and I am wanting to import a actionscript class for use in the main timeline. I wrote the class and imported it, but I get the following errors: Line 1 5001: The name of package 'com' does not reflect the location of this file. change the package definition's name inside this file, or move the file. Here is from the timeline
So I want to create a timeline nav like this site:timeline is a 40 x 40px color filled movie clip that use as the playhead.featContent is the movie clip that contains the feature content.I make the timeline controls the feature contents to slide (using tween class) to the next feature. No problem on this, but I can't make the feature to slide when click on the button.
I have a class called TestMover and it has a function in it which changes its X position. I would like to execute that function from the main timeline. It worked when I used static function but it threw an error when I tried to change the value of X.[code]...
what do i put on the normal timeline of the MouseControlled.fla file to target the character that moves around? Like if I wanted to start coding some objects it might hit that I have on the root native timeline how do I reference it?