ActionScript 3.0 :: Targeting A Button Within A MC From Another MC?

Jan 5, 2010

I know what the error 1061 means, but have no idea how to fix it. I've tried to correct it a million & one ways...

Code:
1061: Call to a possibly undefined method getChildByName through a reference with static type flash.display:DisplayObject.

I'm trying to target a button named 'mcTargetButton' (a SimpleButton) that's inside a movie clip called 'mcTargetParent' from a movie clip called 'mcCallFromThisClip'.

Both clips are on the main timeline. Note, I am using a document class... if I trace (this.parent) from 'mcCallFromThisClip' it prints the name of the document class.

[Code].....

how hard should it be to reach a button from a different movie clip?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Targeting A Button In Flv Skin?

Jun 1, 2009

I want to be able to target a button that is within the skin for a flvplayback component. This is my first real adventure with AS3 and..... (feel like I want to scream!)In the library for the skin I get "fl.video.skin.FullScreenButtonOnOver" and paste this into the main timeline with some code like this.

stop();
function edward(event:MouseEvent):void{ trace ("the button was pressed");}
fl.video.skin.FullScreenButtonOnOver.addEventListener(MouseEvent.CLICK , edward);

which comes back with the error "Access of undefined property fl" - which doesn't surprise me really.What do I do to target taht button

View 7 Replies

ActionScript 2.0 :: Targeting Dynamic Name Of Button

Oct 14, 2009

ActionScript Code:
for (var i:Number = 1; i<=15; i++) {
_root["window_"+i].onRelease = function() {
_global.myvariable = window[i].name ; //doesnt work
}
}

How can i get name of clicked button? In as3 is evt.target.name action, but in as2?

View 2 Replies

ActionScript 2.0 :: Button State Targeting?

Dec 20, 2002

I am creating a Map of the USA that has pins (Buttons) that when you rollover them, they activate information for that particular city. Also on the map bottom, is a list of all the city names represented by each pin. These are also buttons. (So there are basically 2 buttons for each city location on the map.)Here's my question...

Q: How do I tell buttonB to activate to it's rollover state when buttonA is rolled over? And vice versa. Since they are buttons and not MC's, my tellTarget is not working.

View 1 Replies

ActionScript 2.0 :: Not Targeting Button Correctly

Apr 20, 2006

I have a movieclip in a scene that i want to target with the actionscript in the first frame. The movie clip is called up_btn and im trying to target a label called "over" within it.

View 4 Replies

ActionScript 3.0 :: Button Inside A MC Targeting Another MC On The Timeline

Jan 1, 2011

So from the headline u know that i want to do but i don't know how to do it!

ActionScript Code:
/// activate the mc with the button from the main Menu
mathSecondMenu.addEventListener(MouseEvent.CLICK, otvoriVtoroMenu);

[Code]....

the problem is that i can get to the button from the first event, but i can make the Mc "proba" to go to "math_basic"!

View 8 Replies

ActionScript 2.0 :: Targeting Container With Movie Button?

Apr 19, 2006

I'm creating a site with buttons (movie buttons) targeting a container clip on the root which targets transitions in external swfs. I'm having trouble with my code in targeting the container.

I know how to do It with a normal button but not with a button inside of a movie clip...

I can use movie buttons for this because they just look better.

View 1 Replies

ActionScript 2.0 :: Targeting Button Nested In Another MovieClip

Feb 27, 2008

I built a button, but as a movie clip. It's nested with in another movie clip on the main timeline. How do I go about targeting the button?- when I have it on the main timeline, it works fine. But once it's nested. The action script can't find it.

Here is the code I'm using:

btn1.onRollOver = function () {
this.gotoAndPlay("in");
} btn1.onRollOut = function () {
this.gotoAndPlay("out")
}

View 10 Replies

ActionScript 3.0 :: Targeting A Button Inside Dynamically Loaded SWF

Jun 4, 2010

I have a main.swf which loads a sub.swf. Inside the sub.swf is a button instance (myBtn). How do I access myBtn from main.swf timeline?

View 7 Replies

Flash :: Targeting Multiple Buttons And Get Different Value By Clicking Different Button

Aug 8, 2011

I want to target multiple buttons and get different value by clicking different button.

Suppose there are 3 buttons: "button01", "button02, "button03".

This is my code:

var targetArr:Array = ["button01","button02","button03"];
for (var i:int = 0; i < targetArr.length; i++)
{
var target = getChildByName(targetArr[i]);

[Code]....

Instead of getting different value by clicking different button, I constantly get "3" as the value. I want: clicking "button01" will get "0" as the value, clicking "button02" will get "1" as the value, and clicking "button03" will get "2" as the value. How to do it?

View 1 Replies

ActionScript 3.0 :: Targeting A Button To A Frame Inside A Movieclip?

Jul 9, 2009

How do you target a certain frame number/name from outside of that specific movieclip?

Code:
whoweare.addEventListener(MouseEvent.CLICK, whoweareClick);
function whoweareClick(event:MouseEvent):void{
gotoAndPlay("whoweare");
}

I'm assuming it's something with the gotoAndPlay function... but I've tried numerous things with that and nothing is working.

View 3 Replies

ActionScript 3.0 :: Targeting A Button Inside A Movie Clip?

Feb 10, 2010

Trying to target a button inside a mc in order to trigger a swf.the mc is called "nav_btns"the button is called "contact_btn" The swf has the same name as the listener in order to repeat the function with multiple swfs. my problem is, i'm getting an error of an Access of undefined property with my mcI geting an error:"1120: Access of undefined property nav_btns.

my code:
var Xpos:Number = 461;
var Ypos:Number = 294;

[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

ActionScript 1/2 :: Targeting Movie Clip Button Within A Movie Clip?

Feb 26, 2011

I am trying to target a movie clip within a movie clip.
  
I have a movie clip on the main stage with an instance name of a
  
I have the following action script on it
 
on (release) {_root.a.gotoAndStop(2);
}

So on frame 2 of a I have a button (instance name b) which also has two frames and a stop action on frame 1. All I want to do is click on the button and make it go to frame 2. It should work but it isn't Here is the actionscript on the button (b) on (press) {_root.a.b.gotoAndPlay(2); }

View 2 Replies

ActionScript 2.0 :: Targeting A Mc With Within A Mc?

Mar 2, 2006

I have made a navigation that is a movieclip, now within the movieclip are 6 movieclips that are the "buttons" of the navigation. This is then placed on the maintimeline as the movies navigation. When one of the "buttons" is pressed i want it to go to a specific point on one of the 6 movieclip "buttons" timeline. This is the code that I have used before on the maintime line to target a movieclip there... but never a mc within an mc. First, would I still place this code on the maintime? or within the mc that the 6 mc buttons are placed? Second how would I target the nav buttons mc's?

stop();
but1.onRelease = function() {
this.gotoAndStop(9);

[Code]....

View 2 Replies

ActionScript 2.0 :: F8 Targeting Gets Lost

Jan 15, 2009

I've got a dynamic textfield clip which is placed twice on the stage. It also includes a button. Funny thing is, the first trace works (tracing its _y value: 0 for clip 1 and 200 for duplicate clip 2). When I press the down button of both clips however it traces undefined though it's the same line. How does onPress mess up the targetting of both clips? [code]

View 6 Replies

ActionScript 3.0 :: Targeting A Loaded Swf

Nov 11, 2009

1. I'm loading an external swf onto my main swf.
2. Then I'm tweening an object which is separate to the loaded swf.
3. When the tween has completed I'm calling a function to make the loaded swf gotoAndPlay(2);

[Code]....

View 8 Replies

Targeting Label In External SWF?

Feb 12, 2010

I have 2 SWF (swf1 and swf2). I want to load swf 2 into 1, but getting it start on a label or a particular frame.I use this to load SWF 2

Code:

on(release){
loadMovie("movie2.swf",0);
}

How do i target it to start from a label in a scene from movie2.swf?

View 3 Replies

ActionScript 3.0 :: Targeting MC Already Placed On Stage?

Apr 28, 2011

I'm trying to target an MC that is already placed on the stage (as opposed to adding it from the library).

But I get this error:

Quote:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com::Test()
at objects_fla::MainTimeline/frame1()

[Code]....

View 5 Replies

ActionScript 3.0 :: Targeting An Instance Of A Mc?

May 27, 2009

With AS2 I u sed to do  createEmptyMovieClip("name"+i, to create multiple instances of an mc. I ocuuld then target these individual instances

[Code]...

View 4 Replies

ActionScript 3.0 :: Targeting An Event From A Different MC?

Feb 4, 2011

I made a  play/pause button for this project I'm working on (basically a slideshow with a different movieclips on each frame) and I have managed to get it to  target either the main timeline or a nested MC. The problem is with the  code I have is that the button will only work for one MC at a time. This  means I will need a separate play/pause button for each individual  slide. Is there some way to make a button that globally starts and stops  any MC without effecting the main timeline?
 
Here is the code I am using now:
 
stop(); 
pause_btn.addEventListener(MouseEvent.CLICK, stopplaying);function stopplaying(event:MouseEvent):void {    MovieClip(parent).green.stop();    gotoAndStop(2);}
 
Ned proposed adding an event at the beginning of each movie clip and programming the play/pause button to work that way. My problem (after spending a lot of time with it) is that I can't get my play/pause button (a MC itself) to target the event in a separate MC. 
 
This is my event placed on the first frame of my movie clip:
 
dispatchEvent(new Event("imHere"));
  
This is the code I have in the play/pause button that doesn't work:
 
stop(); 
pause_btn.addEventListener(MouseEvent.CLICK, stopplaying);function stopplaying(event:MouseEvent):void {    gotoAndStop(2);}

[Code]....

View 8 Replies

ActionScript 2.0 :: Targeting SWF From Another One In ECard

Jul 31, 2009

I am building an ecard, and I created two swfs. The first swf is the actual ecard, with a dynamic text box that is going to display the message. The second swf is where you would actually type in the information, such as name, email, and message. Is it possible for two swfs to "talk" to each other inside an html document? Also, I am not quite sure how to send the card to someone's email. I am assuming that when you hit SEND it reads the input box with that email, but not sure how that works.

View 1 Replies

Actionscript 3.0 :: Targeting A Mc In A Different Timeline?

Dec 30, 2009

I have a main.fla which has 3 movieclips inside it. All 3 mc's have timelines that run 40 frames. The main.fla timeline has each mc instance on a frame.

mc_1 is on frame 1
mc_2 is on frame 40
mc_3 is on frame 81

as the main timeline plays the clips each one fades to the other.

I need to know how to target this scenerio

after mc_3 plays I need to have a goToAndplay (frame) set up so the animation inside mc_1 starts playing (frame 20) of mc_1.

I know how to do off a button

but there is no buttons, the action needs to happen when the playhead reaches the last frame of the main timeline in main.fla

View 2 Replies

ActionScript 2.0 :: Targeting External .swf's?

Oct 5, 2004

targeting external .swf's.I am trying to load external movies to a main movie in a branched manner (i.e. root -> first movie has buttons to load second -> second movie has buttons to load third) in specific areas on the main movie.

In this simple flash im trying to get the main-button to load onto the main movie. Once it loads, a button appears and replaces the black square. When you click on it a series of other buttons appear on the side and replace the red square. Once those buttons appear, when one clicks one of them a small movie loads into the blue square and replaces it.

View 3 Replies

ActionScript 2.0 :: Targeting Loaded .swf?

May 1, 2003

this code is working to load and position the external swf, but it won't gotoAndPlay to the frame inside the external swf--what am doing wrong here?

PHP Code:

bio.onPress=function()[code]......

View 3 Replies

ActionScript 2.0 :: Targeting A Nested MC?

Jul 13, 2006

I am creating a drop down menu and having problems adding problems to the nested MCs. I have all the actions on the root timeline and I have a one Main_MC which holds several Sub_MC's.I have the Main MC animated fine but I can't find how to control the Sub-MC's.Here is a sample of my code and I have tried _root. and this. and show below but I can't get it to work.

//main MC
Main_MC.onRollOver = over;
Main_MC.onRollOut = out;[code].....

View 9 Replies

ActionScript 2.0 :: Targeting Function Within MC?

Jul 14, 2006

I am trying to start and stop an animation from outside of the main timeline. I have written the functions inside the movie to start and stop the animation and they work fine when called from within the movieclip but when I call them from the maim timeline I get nothing. I have checked the targeting is correct and can't think what this is

View 6 Replies

ActionScript 2.0 :: Targeting A Fame?

Jun 19, 2003

i have three MC's 1,2,3 and a button for each of them, on pressing each button it makes the appropriate MC play half way then stop at a frame with a stop action. BUT what i want is to use a if statement something like this

script is on MC1 button

tell MC1 to play ();
if MC2 is at frame xx
tell it to play ();

eles do nothing

View 4 Replies

ActionScript 3.0 :: Geo Targeting In Flash?

Feb 23, 2010

Something has come up where we may need to do some geo targeting to deliver different content to a video player based on the client's (as in end-user) location. Basically, we would want to control the delivery based on country. This sounds like a huge, deep topic that I can't even begin to address. Anyone have any thoughts or experience doing this sort of thing with Flash content?

The swf may need to sit on a server we have no back-end access to, so ideally it would be a solution that doesn't require PHP or any other sort of back end...but I'm not sure if that's possible.

View 2 Replies

ActionScript 3.0 :: Targeting MC Inside Of MC?

Mar 12, 2010

I have 10 MC that are generated inside of a for loop. Each MC got another MC inside of it that is already sitting on the stage and has it's own instance ame applied! After that I put them inside of a MC container, that I also add dinamicly through the addChild method! But I have one issue when I want to change the position of the child MC(one that is sitting on the stage), through targetting to it's instanceName! The code I use:

Code:
var box1_mc:Box1 = new Box1();
var ball1_mc:Ball1;
var balls:Array = new Array();

[Code].....

View 1 Replies







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