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


Similar Posts:


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

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

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 3.0 :: Access The Root Timeline From A Movie Clip?

Jun 9, 2009

What the best way to access the root timeline from in a movie clip?

View 3 Replies

ActionScript 3.0 :: Root Timeline - Access The Main Time Line To Send It Over To The Page Services?

Nov 3, 2011

I have a label on my root timeline called "services". I have a services button inside a movie clip. How do I access the main time line to send it over to the page services? I'm using actionscript 3. Back in the day it would have been as simple as root.gotoandplay("services")

View 5 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 3.0 :: Access To MovieClip From Root?

Dec 9, 2009

PHP Code:var Root:MovieClipvar container=MovieClip;function menuPress() {trace("trace");}function doIT(parameters,WIDTH,HEIGHT) {container=MovieClip(parent.parent.parent);trace(container.name)//HELP Root=MovieClip(parent.parent.parent.parent); 

[Code]...

View 2 Replies

ActionScript 1/2 :: Movieclip Cannot Access Root Object

Jul 6, 2009

I am making another game, and I'm having a problem with the level loader.[code]...

View 9 Replies

ActionScript 3.0 :: Reference A MovieClip On Root Timeline From Document Class?

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

ActionScript 3.0 :: MovieClip With Button On Main Timeline - Targeting Root?

Oct 31, 2011

If I have a movieclip on the main timeline, and a button in that movie clip. How would I go about getting it to advance the main timeline to its next frame? I understand that in AS3 movie clips are not connected to the timeline in the same way as they are in AS2 but I dont understand why the following works, or if there is a better way?

stop();
next_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent) {
MovieClip(this.root).nextFrame();
}

View 2 Replies

Professional :: MovieClip Animation Playing While Editing Root Timeline

Jun 27, 2010

How do I make it so that the movie clip animations play when I'm editing the root timeline?

View 3 Replies

Make Button In Movieclip Target Back To Main / Root Timeline?

Oct 1, 2009

I have some submenu buttons in a movieclip on the mainline. My first level of navigation in on main timeline. The submenus are grouped in movieclips on the main timeline. I basically used the same code on the main navigation for the sub navigation except the code for the submenus is in that movie clip. My trace statement reads the button is clicked (which was a quantum leap for me) but I know I need some kind of _parent code in there so it knows to go to label back on main timeline.[code]...

View 3 Replies

ActionScript 3.0 :: Access Relative Variables Of Movieclip Instances From Root Or Other Movieclips

Feb 1, 2010

In AS3, how can you access a relative variable within a specific movieclip on the stage?I have a test file that changes the variable "myVar" in one of the displayobject movieclips drawn on the stage. I want to simply trace the current value of this displayobject's myVar for additional purposes.In AS2, you would achieve this by calling the instance name and then the variable contained within.Assuming 3 movieclips existed on the stage named Container1¯, Container2¯ and Cotainer3¯trace(_root.myContainer2.myVar);// returns Hello which is value of variable "myVar" within the movieclip instance named "Container2".How would you do this in AS3?[code]

View 6 Replies

Actionscript 3 :: Access A Movieclip On The Main Timeline From Within A Movieclip?

Mar 6, 2012

Working on an RPG type flash, and I have to be able to control a text-box from quite a few locations. The one that is causing me trouble is the inventory. I need to be able to access the textbox with an instance of "statusWindow" from within the inventory clip (instance name "inventory"), so when I mouse over an item within the movieclip it will change the status window on the stage.In this instance I want to mouse over inventory.invHealth from the main timeline to get the display.itemName and itemProps are strings containing information about the item.I tried the following but it gave me a "possibly undefined" error.

invHealth.addEventListener(MouseEvent.MOUSE_OVER, itemStats);
function itemStats(e:Event):void
{
root.statusWindow.text = itemName+"
"+itemProps;
}

View 1 Replies

ActionScript 3.0 :: Access A Movieclip Within A Class On Timeline?

Dec 12, 2011

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?

View 3 Replies

ActionScript 3.0 :: Button To Access MovieClip In Main Timeline?

Nov 2, 2009

as always, this seemed simple in AS2, but i am stumped with this simple command in AS3.
 
i have a main timeline [one scene] that has multiple movies, one after each other, in different frames.  i need the buttons that are placed in a layer below the movies to access various movies in the scene.  was really simple in AS2.

it appears that i can get my button to go to the frame, but the movie contained in the frame will not load and or play. [i have 2 frames dedicated to each movie, the second frame, in the actions layer has a stop command].  the following is the actionscript and the errors i am getting.
 
AS3:
food_btn.addEventListener(MouseEvent.CLICK, playfood);
function playfood(event:MouseEvent):void {
gotoAndPlay("food");
}

[Code].....

View 3 Replies

ActionScript 3.0 :: Access Movieclip On Different Frame Of Main Timeline?

May 21, 2009

I have two frames in the timeline of my flash file. On frame 1 there is a movie clip. How can I access this movie clip with code located in frame 2?

It doesn't matter whether the mc is already placed on the stage or is added dynamically from the Library - I just need to access the alpha property. I can provide a more detailed description of my file if needed.

View 3 Replies

ActionScript 3.0 :: Nested Button Access MovieClip On Main Timeline

Feb 5, 2010

I have a button inside a movieclip. When the button is clicked I want it to make a movieclip in the main timeline go to a specific frame. what's the code I need to use to define that movieclip located on the main timeline? Right now I have my code written inside the movieclip where the button is located because I have multiple buttons on multiple frames, and I don't know the syntax to define a button in a specific frame inside a movieclip.

Here's my current coding...
Code:
Select allfunction bwbtn2(btn:SimpleButton,frame:Number) {
btn.addEventListener(MouseEvent.CLICK,function() {photobw_img.gotoAndStop(frame);});
}
bwbtn2(bw19_btn,19);

View 2 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 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 :: 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

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

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

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

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

ActionScript 3.0 :: Reference A Root Timeline From Loaded Swf

Dec 12, 2009

I'm loading a lightbox as an image gallery, but I'm working on changing it to full flash. My site is structured with external swfs. I ran into a barrier, because I'll need to load the images (and reference the stage size) in the root timeline, but I don't know how. MovieClip(root) only references the smaller loaded swf's main timeline.

View 1 Replies







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