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


Similar Posts:


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

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 3.0 :: GotoAndPlay Movie In Root?

May 24, 2011

In the past I've used _root.smoke.gotoAndPlay(1);.I can't seem to target this "smoke" movie clip that is on the root with actionscript 3.

View 7 Replies

MX Making Root Movie Clip Invisible?

Apr 11, 2009

I have a button inside a movie clip that when pressed it launches another movie clip. That part works great. The problem I'm having now is either removing the original movie clip or at the very least making it invisible when the next movie launches. So far for my button script this is what I have:

onRollOver=function(){
this.gotoAndPlay("_over");
};
onRollOut=function(){

[code]...

View 3 Replies

ActionScript 1/2 :: Load Movie In Root And Go To Particular Frame?

Oct 10, 2009

I have main flash file called index.swf and in that I'm loading an external movie called help.swf using the below code: loadMovie("help.swf",1);

On help.swf I have a button which brings me back to the main file i.e. index.swf using the below code. _root.loadMovie("index.swf");

When index.swf is loaded I want it to go to a particular frame. I tried using levels but then my print function doesn't work properly.

View 1 Replies

ActionScript 3.0 :: Link In Root Movie Not Working?

May 15, 2011

I have a problem trying to get a button to go back to the start of the a main movie. I have added the button(see below) into the main movie which is only one frame and contains a quiz movie. I want the start button to be visible in the quiz movie (which happens ok) but want it to link back to the main movie when clicked. The link is not working and no errors are showing.

ActionScript Code:
import fl.controls.Button;
var startTextFormat:TextFormat = new TextFormat();
startTextFormat.bold = false;

[code]....

View 1 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 :: Go To The Next Frame Of Root From A Movie Clip?

Dec 6, 2005

I am trying to do up the framework for a flash project which has a transistion fadein and fadeout whenever it loads a new content but faces no result. How is this done? I have created fade in and fadeout as movieclips. Is there any script that I can use in my fadein movie clip that tell the root frame to jump to another frame?

View 3 Replies

ActionScript 2.0 :: Unload Movie On Root From Child?

Oct 5, 2011

I'm loading a movie in externally. The external movie has a button to unload itself from the main movie. It loads into _root.calContainer. The button is called xButton. This is the script that's not working:

_this.xButton.onRelease = function() {
_global.calContainer.unloadMovie;
}

I've also tried. _root.calContainer to no avail.

View 1 Replies

ActionScript 2.0 :: Flash Root Movie Resize?

Dec 18, 2006

My problem is this - I have a parent flash movie of size 900x800. I have a button inside this parent that then loads an external swf (size 300x200) into an empty mc in the parent.My problem is that when the external swf loads, it resizes the parent movie (or repositions it depending on whether I am using IE or Firefox).I can't seem to work out why or how it's happening, and it happens whether I use the standard Flash embedding or the swfobject method for my HTML page that the movie is embedded in.The actionscript code in the parent is very basic:

Code:
but1.onRelease = function() {
_root.createEmptyMovieClip("mp3_player", getNextHighestDepth());

[code]......

View 1 Replies

ActionScript 2.0 :: Controlling Movie Clip Speed From Root?

Mar 2, 2010

In my document I have my actionscript on Layer 1. In this I duplicate an enemy movie clip.The controls for moving the enemy are inside the enemy movie clip, so setting speed, where to start from etc.On the Layer 1, I also run a script which acts as a timer, and when it reaches set values (eg. 10 seconds) it "levels up" (basically just changes background colour). I wand this to increase the speed of the enemy movie clips so that they get faster. I have this code:

Actionscript Code:
for(i=1;i<=enemies;i++){  _root["enemyRight"].duplicateMovieClip("enemyRight"+i,i+1000,enemyRight); 

[code].....

View 2 Replies

ActionScript 2.0 :: Load Movie And Goto Frame In Root?

Feb 2, 2011

I have an swf with a menu button that loads an external swf on(release) {loadMovie("Unit-Type.swf",_root.MC_UnitTypes);}When that menu movie is loaded I want to be able to click a button and have it go to a certain frame in the root movie and close itself. I have this code but it's not workingon(release){_root.gotoAndPlay(25);}

View 1 Replies

ActionScript 3.0 :: Controlling Root Timeline From Movie Clip?

Nov 18, 2008

I'm trying to control the root timeline from a movie clip. On the last frame of the movie clip, I have:

MovieClip(root).gotoAndPlay (10);

which successfully brings me back to frame 10 on the main timeline. However, from here, none of the ActionScript that is on Frame 1 seems to work... the rollovers aren't working, except on those embedded in a separate movie clip.

View 2 Replies

ActionScript 1/2 :: Load Movie And Goto Frame In Root

Feb 2, 2011

I have an swf with a menu button that loads an external swf: on(release) {loadMovie("Unit-Type.swf",_root.MC_UnitTypes);} When that menu movie is loaded I want to be able to click a button and have it go to a certain frame in the root movie and close itself. I have this code but it's not working: on(release){_root.gotoAndPlay(25);}

View 5 Replies

ActionScript 3.0 :: Control Root Timeline From A Movie Clip

Oct 1, 2007

In Flash CS3 using Action Script 3, how can I tell the main timeline to gotoAndStop(); a certain frame from within a movie clip.

I have a menu (which is a movie clip) with various buttons. Each button corresponds to a certain frame in the main movie. So if a user click on Button1, it should gotoAndStop(1); and Button2 should gotoAndStop(2); and so on.

In Action Script 2, I could use _root.gotoAndPlay(2); from what I understand, but that does not work in Action Script 3.

View 9 Replies

ActionScript 3.0 :: Controlling Loader On 'root' From Movie Clip

Nov 4, 2009

I have on my main timeline a movie clip (emptyMC) that I am loading my external SWFs into and I need to be able to access this loader movie clip from my menu, which is it's own movie clip. As it stands, when I have my buttons on the main timeline I have no issue. But once I put these same buttons into the menu MC I am lost as to how to "get back" to the loader on the main timeline to load and unload the external SWFs.Here is my current code that allows for me to load and unload with buttons on the main timeline. Is there away to modify this same code for my purposes?[code]

View 0 Replies

ActionScript 3.0 :: Attach A Movie Clip To The Stage Or Root?

Nov 12, 2009

how to attach a movie clip to the stage or root. I have created a movie clip called movClip and have checked export for actionscript and have chosen "movClip" as its class.I have used this script:

ActionScript Code:
function button1(evt:MouseEvent):void {
var mc1:movClip=new movClip();
mc1.x=0;

[code]....

This attaches the movie clip. Great! Problem is it doesn't attach the movie to the root or stage, but rather as a child of this function?? weird! so when I want to use removeChild(mc1) from a different function from a different button or even from an action set on a different timeline it can't target mc1?So how do I make this work. Basically I want one function from button 1 to attach the movie clip and I want a second function from a second button to remove the movie clip.

View 4 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 2.0 :: Unloading Movie Clip From Root Container?

Aug 5, 2008

I've created a main page with my main links on top, and a container as my body.I load my pages with this action to the container.

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "production";
container.loadMovie("production.swf");

[code]....

Inside the production.swf files I've created a gallery with a MovieClip that loads from my library to a container1 inside the production.swf. In the galleryMC(from library), Ive created a close button to unload it from the container1. It works fine from my production.swf file, but when it loads to the main page it doesn't unload. This is the ActionScript that I have to unload the Movie Clip.

on (release) {
this._root.container1.unloadMovie();
}

View 2 Replies







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