ActionScript 2.0 :: Accessing Root Function From Timeline?

Aug 17, 2009

im attempting to keep it as portable as possible so its easier to edit later, and i dont have to go around copying/pasting too much code. - i'll cut to the chase..

On my main timeline, i load all the image-file names, as variables.. using loadvars into thumbnails, which ive given instancenames Loader_1 to Loader_20, inside these thumbnails is the Loader component Thumb_1. Here is the code on the main timeline, to load these variables.

Code:
BigLoader._visible = false;
var my_lv:LoadVars = new LoadVars();
// load variable function

[Code]....

how i could make this more portable without -completely- changing the format its in [so i can still understand it]

View 9 Replies


Similar Posts:


ActionScript 3.0 :: Accessing Variables On The Root Timeline?

Feb 18, 2008

I have some variables declared on the root timeline that I need to access from some MovieClips. In AS2 I would do something like this _parent.myVar from within my MovieClip. I intend on getting fully up to speed with AS3 but right now I need a quick fix.on the root timeline I have a variable : var myHitTest:Boolean = false;My MovieClip needs to access this var so I tried it several ways listed here. I've had no success.

parent.myHitTest:Boolean
root.myHitTest:Boolean
Stage.myHitTest:Boolean

[code].....

View 6 Replies

Flash - Tell The Root Timeline To Root.gotoAndStop(2); From The Timeline Of A MovieClip Added Using AddChild?

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

AS3 :: Call Function In Root Timeline From Class?

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

ActionScript 2.0 :: Calling A Function To Change Frames In A Mc On Root Timeline?

Sep 26, 2005

I have created a function on the root timeline, to be called at a certain point (when the character is on a certain frame and so is the certain item, he loses a life)the lives_mc advances frame by frame to show lives being lost.heres the function

Code:
function loseLife(){
if(_root.lives_mc._currentframe=1){
_root.lives_mc._currentframe=1[code].....

View 7 Replies

ActionScript 2.0 :: Accessing Function From Another Timeline?

Apr 28, 2005

I'm trying to access this function from another timeline. This function resides on the root level and I want to access it from a button within an MC on the main timeline. How can I do this?

Code:
vol_onBTN.onRelease = function() {
vol_offBTN._visible = true;

[Code].....

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

ActionScript 3.0 :: Reference Main Timeline - Accessing StartClips Function?

Nov 24, 2009

I have a function on the main timeline named startClips. Now, I want to call this from within two movie clips, the other nested inside the other. In other words, I have a movie clip called holder, and inside of a holder, I have a movieclip called homebase. Now, here is all the code I've been trying to use to access the startClips function which is own the main timeline from the movieclip homebase:

MovieClip(root).startClips();
MovieClip(root.root).startClips();
MovieClip(parent.parent).startClips();
this.parent.parent.startClips();

View 8 Replies

ActionScript 3.0 :: Accessing MC In Root Of Movie?

Apr 16, 2009

here's my problem/code:
 
I have a mc in the main timeline named contactBox_mc, within this mc I have another mc named closeBtn_mc. I have added an EventListener to closeBtn_mc to set the visibility of contactBox_mc to false on MouseEvent.Click.. but no matter what method I try, I get the following error:
 
1180: Call to a possibly undefined method contactBox_mc.
 
This is the code I placed within closeBtn_mc to set the visibility of its parent movie to false:
 
closeBtn_mc.addEventListener(MouseEvent.CLICK, closeBox);
function closeBox(e:MouseEvent):void{
contactBox_mc(this.parent).visible = false;
}
 
I also tried: root.contactBox_mc.visible = false; and got the same error,

View 4 Replies

Xml :: Accessing Root Node In Flex

Jan 9, 2010

I'm having trouble accessing the value of the root node of an XML variable in flex. For example:

[Code]....

I can change the "Type" attribute above with X.@Type="xyz"; But how do I change "Content123" to something else? If the xml document were longer/deeper, I could say something like X.Entry[11].Cost=2.22; But what do I say in this case? Obviously X="Content456" doesn't work...

View 4 Replies

Flex :: Accessing Root Of Loaded Swf?

Mar 4, 2012

I have a SWf application built in flex 4. One part of the application relies on accessing a public variable ("step1") set at the application root, and is accessed with

var app:Object = FlexGlobals.topLevelApplication;
trace("step one is "+app.step1);

This, while not optimal, has worked fine. Now, hoever, I need to load this entire application into another application, and I can't figure out how to access my step1 variable any longer.I have been loading the swf into the new parent application like so:

public var myLoader:Loader = new Loader();
public var pizzaContainer:UIComponent = new UIComponent();
private var myUrl:URLRequest = new URLRequest("chickensoup.swf");

[code]......

View 1 Replies

ActionScript 3.0 :: Accessing Mc Functions From The Root?

Sep 22, 2009

How can i access a function that is in a movieclip from the root?

i've tried these :

mcName.functionName();
MoviClip(mcName).functionName();

but all of them didn't work at all.

View 1 Replies

ActionScript 2.0 :: Accessing Text Box In A Movieclip From Root

Mar 23, 2007

I'm trying to change the text on a textbox called "text1" that is part of a movieclip called "menulist" using actionscript. How can I access text1 with actionscript?[code]

View 6 Replies

ActionScript 2.0 :: External SWF Accessing Root Variables

Dec 10, 2007

My flash project is structured as follows, with the nested external swfs being loaded to clip holders using loadMovie():
home.swf
|--sponsors.swf
|--educators.swf

In home.swf, I've defined a text box with instance name contentWindow_txt, and assigned its path to _root.cw_txt. Now, when I type the following anywhere in home.swf:
Code:
_root.cw_txt.htmlText = "testing!";

The dynamic text box contentWindow_txt will display "testing!" when the swf loads. Unfortunately, when I make the same call in sponsors.swf, I get nothing. Is there something about external swfs or variable inheritance I don't know?

View 9 Replies

ActionScript 3.0 :: Accessing Parent Root From External Swf?

Jul 23, 2009

I am able to access main root from an external swf by doing this:

MovieClip(root.parent.root)

but how to avoid getting an error when testing external swf alone? Is there any try catch system I can do to avoid thoses errors?

View 1 Replies

ActionScript 3.0 :: Accessing Root From A Dynamic Clip?

Jun 13, 2009

Basically I have a _mc that I am calling in from the library. When I get to the end of the clip I want it to advance the root time line to frame 3.This is the code I have at the end of the _mc

MovieClip(root).gotoAndStop(3);

This is the error I get :Error #1009: Cannot access a property or method of a null object reference.at introScene/frame91()

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@44370ba1 to flash.display.MovieClip.

View 2 Replies

ActionScript 3.0 :: Accessing Class Instance At Root From Movieclip

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

Professional :: Accessing Class Instance At Root From Movieclip?

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

ActionScript 3.0 :: Accessing Class Instance At Root From Movieclip?

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

ActionScript 2.0 :: Referencing Root Timeline From Within A Mc

Aug 20, 2006

I have a root timeline in which contains a movie clip on a certain frame. Inside that movieclip, on it's second frame, there is a button. I would like to use this button, when clicked, to move take the user to a frame on the root timeline.

View 5 Replies

ActionScript 3.0 :: Navigate To Root Timeline?

Jun 29, 2010

So im new to AS3 im trying to do some basic things that i knew in as2 but they arent working in AS3.Im basically trying to do this.this.gotoAndStop("1");basically i just want my main timeline to jump back to the beginning the main time line

View 2 Replies

ActionScript 3.0 :: Can't Access A MovieClip On The Root Timeline?

Mar 26, 2009

What I'm trying to do is very very basic however its flat out not working. I'm trying to add a event listener to a button located within a movieclip thats on the root time line.Here's the code:

Code:
function main_init():void
{

[code].....

View 2 Replies

ActionScript 2.0 :: Check To See If The Root Timeline Is At A Certain Frame?

Jul 7, 2009

I am using Flash CS4 and Actionscript 2.0, and I want to be able to run a certain command for a time I am making only on certain frames...

[Code]...

This doesn't work. The reason I am trying to do this, is because every time I complete a level the timer is still going at the 'congratulations screen' and then when I go to level 2 the timer would start up again, and the seconds would go twice as fast.

View 1 Replies

ActionScript 3.0 :: Can't Access The Root Timeline From A Movieclip

Feb 24, 2010

I have a movielclip, nav_mc, inside which contains my navigation buttons. Lets say I want to effect the time timeline. Before in AS 2.0 I could simply go

jan1_mc.onRelease = function() {
_root.january_mc.gotoAndStop(2);
}

Now in AS 3.0, nothing works.

button_mc.addEventListener(MouseEvent.MOUSE_UP, doIt);

function doIt(evt:MouseEvent):void {
_root.january.gotoAndStop(2);
}

That doesn't work. Returns this in errors:

Warning: 1058: Migration issue: The property _root is no longer supported. This property has been removed. The closest equivalent is the Stage, which serves as the root of the ActionScript 3.0 display list..

Neither does

root.january.gotoAndStop(2)

or

stage.january.gotoAndStop(2)
(1119: Access of possibly undefined property ball_mc through a reference with static type flash.display:Stage.)

or

_stage.january.gotoAndStop(2)

or anything!

How do we do this very simple thing now in AS 3.0

TLDR;

How do I reference the _root timeline in AS 3.0 since _root. no longer works in 3.0

View 3 Replies

ActionScript 3.0 :: Calling An MC On Root Timeline From Inside Another MC?

Apr 12, 2010

how can I call an MC on root timeline from a button inside another MC?

View 1 Replies

Actionscript :: Can't Access The Variable From Root Timeline

Mar 11, 2011

I created a movieclip called holder in my Stage and I name it, inside them i put a variable called

name = "whatever"

Now I can't access the variable from root timeline, I try this:

trace(holder.name);

The result gives me undefined! what mean this?

View 1 Replies

ActionScript 2.0 :: Referencing Functions In Root Timeline

Jun 30, 2009

I have a 13 movieclips within another movieclip which in turn is placed on the root timeline. I have written a function in the actions layer of the main timeline:
function illboxClear(){
_root.illpre.ill1.gotoAndStop(1);
_root.illpre.ill2.gotoAndStop(1);
_root.illpre.ill3.gotoAndStop(1);
_root.illpre.ill4.gotoAndStop(1);
[Code] .....

It sends the animation in each of those described movieclips back to frame one as you can see. When I try to call the function from actions on a button which itself within a separate movieclip placed on the stage:
on (rollOver) {
illboxClear();
_root.illpre.ill2.play()
} on (rollOut) {
_root.illpre.ill2.play()
} on (release) {getURL("boxer.html","_blank");
}
It doesn't work! Can I not call functions from button objects or have I made some other elementary error?

View 7 Replies

Movie Clips - Layers On Root Timeline?

Feb 28, 2010

I have only been using FLASH CS3 for a little under a month. I have messed about with it to create some basic stuff. However recently I started on a bit of a larger project. I 'm by no means an expert in FLASH CS3 or AS3.My problem -I created a .FLA file that has seven movie clips on the main timeline, each in its own layer. These are listed below in the order they appear within the main time line.

layer ------------ movie clip
ON -------------- on_mc
RIM ------------- rim_mc
NAV-------------- coverbase_mc
PLAYER---------- player_mc
MAIN------------- main_mc
NAMEBOX------- shellname_mc
BASE------------ Base_mc

The art work for these was all imported from adobe photoshop. They all only have one frame on the main timeline. Each movie clip though has its own internal time line and some have further nested movie clips within them.The issue occurs within the NAV layer/coverbase_mc. I placed a movie clip(to act as a button) within coverbase_mc. This movie clip is called navbut_mc.Now, I already have a couple of similar movie clips, that act as buttons, in on_mc and rim_mc these work as I intended them to. However navbut_mc does not work at all in its current position. I get no errors at all on testing the movie but the action that I want it to do does not work even buttonmode = true; will not work on it.

However, if I use the same movie clip in the rim.mc, but obviously give it a seperate instance name (start_mc), then it works as intended. I have looked at various diffrent things but have to admit i'm stummped. Its almost as if when its in coverbase_mc its being hidden by the clips above it, if thats possible.The reasons I need it to work in coverbase_mc are for a) the overall look of the project b)I have some other buttons in that location that need to work from there.

View 1 Replies

ActionScript 2.0 :: Controlling MovieClip On Root Timeline?

Aug 19, 2008

My stage is empty except for an MC with a simple animation and an AS 2 layer. There is not a button or user interaction that engages the MC. I want the MC to play when the timeline reaches the frame with the AS. My MC has an instance name of 'blueMC' and here's the AS I've tried:

blueMC.play();
_root.blueMC.gotoAndPlay("2");
on(load){
blueMC.play();
} onClipEvent(load) {
blueMC.gotoAndPlay("2");
}
Shouldn't it just be this?:
MCinstanceNmae.gotoAndPlay("Frame# or label");

View 1 Replies

ActionScript 2.0 :: Passing Variable From Root Timeline Into MC?

Aug 15, 2009

I'm guessing this is pretty simple, I just can't find the solution through my google searches.

Bascially I created a variable and gave it a value in the first frame of my main timeline.

Now I just want to pass that variable into a MovieClip. When I trace the value of the variable within the movieClip I get undefined.

Is there something else I have to do to make it recognize the root timeline's variable?

View 1 Replies







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