ActionScript 3.0 :: Getting A Root Var In A MC Class?
Sep 3, 2009
I have a variable on the root timeline that I would like to check for in a class of one of my movieclips. The movieclip get added to the display list via addChild. If I check for the var, I get this error message:1120: Access of undefined property myVar How can I be able to see that var?
View 7 Replies
Similar Posts:
May 3, 2010
I have a class called shapeC that only creates a rectangle and then addChild(rectangle);. That class is instantiated on the main timeline. Currently, the only way you can see that rectangle is to add the instantiated class to the stage via addChild(shapeC);. My question is, is there a way that the shapeC class can add the rectangle to the root stage without requireing the instantiated class to be added to the stage?
View 4 Replies
Feb 4, 2011
How do I communicate from a class to the root? I've got a class that does some different things including communicating with a webserver. When it does its thing, I want it to communicate that back to the main part of the program. I'm thinking that an eventdispatcher could do it, but I haven't been able to get it working right. When all is said and done in my class, I tried including:
[Code]...
View 1 Replies
Aug 27, 2010
How are they related?
Are they the same?
Is using "MovieClip(root)." from anywhere actually equivalent to coding in the document class?
What's different in their effect on the display list?
View 1 Replies
Sep 24, 2009
I am working with a simple MVC pattern.
But in my model i try to do this:
Main(root).Message(" model done!");
But i cant pass in the root, couse the model classes are Eventdispatchers and no sprirtes.
View 1 Replies
Dec 21, 2010
I made this class and I put it in the same package of Timeline.as (the Document Class):
package {
import flash.utils.Timer;
import flash.events.TimerEvent;
public class Counter2 extends Timer {
public function Counter2(delay:Number, repeatCount:int=0) {
[Code]...
View 1 Replies
Dec 8, 2011
I want to call a function that is inside the root timeline of Flash from an external class.
This code is from the class:
private function loadImage(event:Event):void
{
addToContainer()
}
[Code].....
View 3 Replies
Dec 6, 2010
I have this in my fla (Actionscript 2)
import com.pw.Pts;
var gUnitId:String;
I have this in Pts.as
class com.pw.Pts {
function Pts()
{
trace ("Inside constructor");
[Code]....
I want the variable gUnitId in the fla file inside the class file.
View 5 Replies
Nov 5, 2010
I'm trying to do a simple game like tetris.I have a class "tile" that have got timer event, and every 50ms move my tile.y+=1. So every time I call for a new tile, it will go down until reach bottom of a stage. And the thing is, when the tile will hit another tile, he is still going down until bottom, becouse I dont know how to myTimer.stop(); in the tile class from the root.
View 2 Replies
Feb 13, 2009
h1. I have a Class (let's call it "Button") that is linked to a library item (a movieclip) which I have on the stage
2. Now this Button class, when clicked will produce an alert in the form of another class (let's call it "Alert").
3. There are two critical things in the way I want this to work:
A) I want Alert to be a child of the main stage, not the Button class
B) I want Alert to take care of adding itself to the display list, not have Button add it.
So in a nutshell, I want to call Alert like this:new Alert("Hello, Kirupa Forums!");
The Alert class needs to draw the shape (check), add the text (check), add itself to the display list (how? if I try to access "stage" I get a null reference, though I don't know why), and destroy itself (I'll burn that bridge when I get to it).
View 4 Replies
Nov 15, 2010
I have declared a object in my 1 st frame of application.
ActionScript Code:
var objTest:Test = new Test();
I am tring to access the object from a movie clip. Movie clip is located in frame 2. I am getting error
ActionScript Code:
this.parent.objTest.IncrementCount();
trace(this.parent.objTest.QuestionCount);
1119: Access of possibly undefined property objTest through a reference with static type flash.displayisplayObjectContainer.
How to access a object instantiated at root from a movie clip.
View 1 Replies
May 22, 2009
This is probably ueber basic, but I don't know how to do it. I am importing tweenlite on the root timeline like this: import gs.TweenLite;
I now want animate things in other MCs. I tried something like this, but it did not seem to work.parent.TweenLite.to(text1, 3, {_alpha:100, overwrite:0});
View 5 Replies
Feb 25, 2010
I have declared a object in my 1 st frame of application.
ActionScript Code:
var objTest:Test = new Test();
I am tring to access the object from a movie clip. Movie clip is located in frame 2. I am getting error
ActionScript Code:
this.parent.objTest.IncrementCount();
trace(this.parent.objTest.QuestionCount);
[code].....
View 4 Replies
Nov 13, 2010
Anyways, I've been trying to figure this out for quite some time.Let's say I have my document class. I'm guessing the document class can correspond to the first thing that gets run? (such as the "main" function in most C++/low level languages).If I set a variable in it:var myNumber:Number = 10;how would Iaccess: "myNumber" from other objects in my stage?Like a movieclip on my stage for example.If I go inside that movieclip into the movieclip's first frame, how would I say:trace(TheDocumentClass.myNumber);Another similar question is, what about the actual stage frame?If I click on frame 1 of my stage, set a variable:var aNumber:Number = 5;how would I access it from other objects?In my movieclip's first frame, what would I put?trace(root.aNumber); ?trace(stage.aNumber); ?
View 9 Replies
Nov 16, 2010
I have declared a object in my 1 st frame of application.
ActionScript Code:
var objTest:Test = new Test();
I am tring to access the object from a movie clip. Movie clip is located in frame 2. I am getting error
ActionScript Code:
this.parent.objTest.IncrementCount();
trace(this.parent.objTest.QuestionCount);
[code].....
View 3 Replies
Sep 1, 2009
I've been trying to switch from AS2 to AS3 by forcing myself to use AS3 on every project and never revert to AS2 no matter what the problem may be. Doing this, I've learned a lot so far, and it has shown me that AS3 has the potential to be much more logical and easier to manage, but every once in a while I run into a problem in which research doesn't prevail.
At the moment I'm working on a project that uses the Union Platform. My goal is to make all control over User1's "Reactor" API managed by a single class.
Anyways, I've ran into a very limiting problem that I can't seem to get by. I can't figure out a way to call the root object and be able to call it's functions from a class!
Here's one of the methods that I've tried (No errors were reported, but it did not work) -
main.as:
Code:
package {
import flash.display.MovieClip;
import net.user1.reactor.Reactor;
[Code]...
As you can see, I tried to pass "this" as a MovieClip in hopes that I would be able to use the MovieClip's class functions. (Which is most likely very nooby and completely wrong since it's probably not considered a MovieClip reference, but what do I know?) Everything is fine, except the swf does not go to frame 2 when readyListener() is called. No errors are outputted either.
View 4 Replies
Sep 28, 2009
So I have a MovieClip symbol created in the Flash IDE with a baseClass of flash.display.MovieClip and Class name of "Square". I have placed it on the timeline of my fla at frame 30 and given it an instance name of "square". How can I control that MovieClip from my DocumentClass? I have an ENTER_FRAME listener listening for the arrival of frame 30. At that time I want to simply do something to the "square" MovieClip. But I keep getting a compile-time error of "1119: Access of possibly undefined property square through a reference with static type flash.displayisplayObject.".
[Code]....
View 1 Replies
Sep 29, 2010
and its make me so frustated since so many changes from as2. i have problem when i want to change variable value from class file, here is the detail.
on the root timeline frame 2, i initialized var like below
stop();
var gameStat;
gameStat = "stop";
then i attached penguin movie clip to the stage, and i make class file called "penguin.as"
//untuk hero penguin
package {
import flash.display.MovieClip;
[Code]....
i trace gameStat var in on_enter_frame function, but it still give me "stop" result not "play". how to change the "gameStat" value??
View 1 Replies
Feb 12, 2011
I'm using a PreLoader as a parent SWF that loads the actual website as a child SWF. In the website SWF, the child SWF, will MovieClip(root) still work and refer to it's own root, or the PreLoader's root? And would I still access the websitite's document class (the child's document class), through MovieClip(root)? What if both files have a document class?So my main question is how do document classes and MovieClip(root) behave in the scenario when you have:
Parent SWF - document class, MovieClip(root)
|
Child SWF (loaded by parent) - document class, MovieClip(root)
View 2 Replies
Jan 26, 2010
Im having whta I think is a quite common problem. I recently started migrating form AS2 to AS3 and Im buidling a home made template for all AS3 projects..
I have just loaded portfolio.swf on top of main.sfw. The buttons on portfolio.swf share the same class as the buttons on main.swf
This is the button class:
Code:
package com{
import flash.display.*;
import flash.events.*;
[Code]....
View 9 Replies
Mar 3, 2010
Why does FlexBuilder insist on a main class in the root of the source folder? By insist I mean that if I create an Actionscript project called MainTest. A file called MainTest.as will be placed in the root of the src folder. if I now create a package/folder called some/package and place the MainTest.as in it (and adjust the package statement accordingly), I cannot select the project to use this as the application class in Properties/Actionscript Applications as the package is empty as far as Flexbulider is concerned.
So there is a restriction that a main/application class cannot have a package other than the root package. The mxmlc compiler and FDT do not enforce this restriction so why does Flex Builder?
View 1 Replies
Jul 14, 2009
i have a class .as file which extends MovieClip. inside the .as file there is a public function and when called upon it needs to change the value of a property that is on the maintimeline
Code:
package
{
import flash.display.*[code]....
problem is this error 1119: Access of possibly undefined property gear_num through a reference with static type flash.displayisplayObjectContainer.
View 5 Replies
Sep 26, 2009
How do I import a class that resides outside the root folder of a fla file?
From root I should go back two folders to get the classes I want, which by the way is TweenMax. I don't want to copy these classes to every website's folder.
View 5 Replies
Jan 14, 2009
Situation:
- We have a Flash application located on a SAP EP (let's say ep.x.com)
- We have a SAP ABAP Application (Webservices) on a SAP WebAS
server (abap.x.com)
- Clarification: This is not about Flash islands / but a normal Flash application communicating with WebAS ABAP via WebServices
Problem: Due to the changed security policy in Flash 10 this scenario does no longer work.
- A crossdomain policy file on root level cannot be deployed on root level
- The WebServices http/s headers cannot be modified, since the WebServices are generated by the WebAS IDE.
Comment: Technically there is a way to patch a WebAS ABAP,but this is not a practical / acceptable way in a normal SAP WebAS infrastructure.
Conclusion:- The above scenario (Flash from EP content / WebAS ABAP as backend) is a quite normal scenario in the SAP world.
- SAP / Adobe always features the close relationship between their technologies.
Question:- What could we do?
- How does the Visual Composer works around that problem?
View 1 Replies
Mar 22, 2010
I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?
View 1 Replies
Nov 7, 2011
How do you tell the root timeline to root.gotoAndStop(2); from the timeline of a movieClip added using addChild?In the maintime line I have
addChild(fade_eng);
and in fade_eng I have the following on frame 20
root.gotoAndStop(2);
this.gotoAndStop(1);
But I am getting 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.
View 1 Replies
Mar 24, 2009
I have a button in my main file (Interiors-02.swf) in Scene 1. When I click it it loads an outside swf (buttons.swf) into a blank movie. This movie has 10 buttons. What I want is for when I click one of those buttons to go to Scene 2 or 3 in the main file (Interiors-02.swf) Can I do this and what would the code be for the button?
View 1 Replies
Jun 25, 2007
I'm having some problems importing a class, the message that Flash gives me is this; The class being compiled, 'ImageLoader', does not match the class that was imported, '[URL]'. The only line of code in my flash movie is this: import com.martijndevisser.*; And yes, the class is in that folder The class is from here: [URL] I've used the class before and it works fine, I just dont know what to do?
View 4 Replies
Mar 28, 2009
I have a varible in my root
Code:
place = "1";
i want to refence it in one of my MCs so that i can run a statement like this:
[code]....
View 2 Replies
Sep 16, 2010
I have my main fla and then I have a actionscript named bullet.as in the bullet.as I create a bullet using "this" throughout the script now how would I call the bullet on my main timeline?
View 1 Replies