ActionScript 3.0 :: Controlling MovieClip With Frame Label - Target Path

Oct 5, 2009

I'm trying to control a movie clip called "nosotrosmc" with a frame label inside called "historia" but does not work
Code:
menu.nosotros.addEventListener(MouseEvent.CLICK, subSeccion);
function subSeccion(e:MouseEvent){
trace(""+e.target.name+"boton clicked");
this.nosotrosmc.gotoAndStop("historia");
}

The output window show this:
nosotrosboton clicked
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at HomeSonny_fla::MainTimeline/subSeccion()
I need to made a simple navigation, I'm a designer, not a programmer.

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Path Or Target Frame Inside Of MovieClip?

Mar 8, 2009

I'm trying to reference a specific frame inside a MC in my .swf file from an .as file. What I want is to capture the current frame of the movie clip for the .as file. It's for the purpose of points when you shoot each plane. It's an easy trick of frame 1's plane would be worth 100 points, frame 2's plane 200 points, etc. I thought I'd write a line like this in my collision detection section of my .as file.

Code:
planePoints = currentFrame * 100;

The only problem is, of course, it grabs the current frame of the main .swf timeline that my flash file uses, and not the movieclip that's being called to produce the planes. So I thought I'd be able to specify a path to the movie clip (in this case it's called Airplane in the MC's linkage properties).

Code:
planePoints = Airplane.currentFrame * 100;
Then, of course, it freaks out and says that 'access of possibly undefined property currentFrame through a reference with static type Class.'

I still get confused with AS3 and the way items are handled vs AS2. I've lost track of how many times I type _root. Am I getting something basic mucked up here or should I be importing something in the package to get it to recognize the class?

View 1 Replies

ActionScript 3.0 :: Target Path - Control A Movie Clip Called "nosotrosmc" With A Frame Label Inside Called "historia"?

Oct 5, 2009

i'm trying to control a movie clip called "nosotrosmc" with a frame label inside called "historia" but does not work this is the code:

[Code]...

View 2 Replies

ActionScript 2.0 :: Get This Function To Target MyClip_mc And Movethe Frame Head To Another Frame Label

Aug 30, 2007

I'm trying to get this function to target myClip_mc and movethe frame head to another frame label.

var counter:Number = 1;
//textBeGone
invisible_btn.onRelease = function(){
counter++;
if(counter % 2 = true) {

[code].....

View 2 Replies

ActionScript 2.0 :: Target Path - Go To Frame 2 When Click On Button On 1st Frame

May 25, 2009

there is a button on 1st frame. there is a movie clip on frame 2. I named the movie clip as "ball_mc" I want to go to frame 2 when I click on button on 1st frame. I know that the code "gotoAndPlay(2);" on button will work. But for some reasons, i want to try another way.... i tried several codes:

1. this.ball_mc.gotoAndPlay();
2. _level.ball_mc.gotoAndPlay();
3. _global.ball_mc.gotoAndPlay();
4. _root.ball_mc.gotoandPlay();

However these codes dun work. Is there other way to resolve this besides this code "gotoAndPlay(2)"?

View 1 Replies

Actionscript :: Flash - Controlling A Label On Another Frame?

Apr 30, 2011

I have 4 key frames in my flash project and what i'm trying to do is to go from one key frame to another and make some of the content on the destination key frame invisible using actionscript. I know how to go from one frame to another but i'm having problems finding a way to control the visibility of content from another frame.

View 2 Replies

ActionScript 3.0 :: Get A Button To Target A Frame Label?

Jul 27, 2010

I am having trouble trying to get a button to target a frame label. Right now I have the button inside a movie clip and my idea was to have the click event target a frame label that is outside of the button movie clip. The frame label actually lives within the parent movie clip of the movie clip holding the button. I am using Action Script 3.0 so I am not sure what to do. And not sure if I should have the actionscript inside the nested movie clip or in the parent. Here is what I have so far...

/*
The parent movie clip is called "services_mc"
The nested movie clip holding the button is called "brandID_mc"
The button is called "goback_btn"

[code]...

View 2 Replies

ActionScript 2.0 :: Target A _root Frame Label From Inside MC?

May 28, 2007

Just wondering how this is done within an "if then" statement. I need a code like

if (_root.frame = "home") then {
this.quickHome.onPress = function () {
_root.gotoAndPlay ("homeToContact");
}
}

I know the first line isn't going to work, but just wondering if someone knew of a code that would?

View 2 Replies

ActionScript 3.0 :: MovieClip Target Path Are Soo Complicated?

Apr 26, 2010

I am wondering why the AS3 movieClip target path are soo complicated? I'm loading a simple external swf that contain a movieClip that I want to play with. But I can't find the proper syntaxe to call this movieClip..

var swfLoader:Loader = new Loader();
holderSWF.addChild(swfLoader);
var externalSWF:URLRequest=new URLRequest("externalFile.swf");
swfLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, loadProdComplete);
swfLoader.load(externalSWF);

[Code]...

View 3 Replies

ActionScript 2.0 :: Make A Simple Movie (call It MovieClip) First Frame Has Stop(); Action, Second Frame Has Label PlayMovie?

Nov 6, 2006

1. I make a simple movie (call it movieClip) first frame has stop(); action, second frame has label playMovie, last frame has action gotoAndPlay(2); (so that movie not stop anymore2. Now I place movieClip on stage3. Question... what is code to make movieClip play frame label playMovie?

I already try to put many different type action in frame one of stage
this.movieClip.gotoAndPlay("2"); //NOT WORK
this.movieClip.gotoAndPlay(2); //NOT WORK

[code].....

View 7 Replies

ActionScript 2.0 :: Get The Frame Label Name Of A MovieClip?

Jan 25, 2007

I have a MovieClip created, and the second Frame has a label ("tree0001" for any who care). I'm wondering how I can retrieve the name of this label by asking which frame in the movieclip is loaded (which would be frame #2) and then getting that Frame Label.

View 1 Replies

ActionScript 2.0 :: Go To Certain Frame Label In MovieClip

Jul 6, 2007

I am trying to make it go to a certain point on the movieclip thats called. I am not too familiar with creating functions for frame labels.
clipboard_mc.gotoAndStop("frameLabel");
is where I want to add the code but when I code the button below it doesn't go to the frame that I want it to.

Code:
function btnRelease(myBtns:MovieClip, frameLabel:String):Void {
myBtns.onRelease = function() {
clipboardIn();
noBtns();
} clipboard_mc.gotoAndStop(frameLabel);
}

Button Code:
btnRelease(hand, "hand");

View 5 Replies

ActionScript 2.0 :: Frame Label Navigation In MovieClip

Apr 24, 2007

I want to play 2 separate labels in a movie clip in any order when clicking a button that lives inside that movie clip.

Here's what I have on the button:
on (release) {
gotoAndPlay("location_rev");
gotoAndPlay("residences");
}

Currently, the playhead is going to "residences," entirely skipping "location_rev." I've thought of an if statement to ask Flash to play "residences" when arriving at the end of "location_rev," but I'm not entirely sure how to go about that.

View 2 Replies

ActionScript 2.0 :: Frame Label List In Loaded MovieClip

Jul 7, 2009

Is there any method so that I can find the List of Label in given Loaded MovieClip. I am working on a system that dynamically load SWF from other developers, since these developers has choice, they put some labels in their script. However it is upto them to use any combination of given label, so that, say one developer make labels
Inanimation, OutAnimation, Endanimation

While other make
OutAnimation,endanimation
And third make InAnimation, Endanimation

So when my script load it should read the label on their MC so it can take action accordingly. We are not sure what Frame number they put label, and we cannot change their SWF anyways. The solution I know is I check through their FrameLabels and then take action if XXX frame exists.

View 3 Replies

ActionScript 2.0 :: Calling Frame Label In MovieClip On Second Scene

Dec 28, 2004

I am in a second scene... and am trying to call a frame label in an mc in scene 2 is there a such thing as...
on(release) {
_thisScene.mymc.gotoAndStop("framelabel");
}
this scene?

View 5 Replies

ActionScript 3.0 :: Controlling Nested MovieClip In 2nd Frame

Feb 29, 2012

I've got a play and stop buttons on the stage which are controlling some 3 nested MovieClips, It controlls Well the MovieClip which is located on the first frame, but when I want to stop/play the other two MC's (frames 2 & 3) I get the following error -
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at jukebox_fla::MainTimeline/playMP3()
I know the problem is that I just can't control any other Nested Instances of a MovieClip Unless it is located on it's First frame. How can I stop/play the other 2 MC's (Frames 2 & 3) by coding from the main stage?

View 0 Replies

Flash :: Closing A Movieclip And Return To Scene One (and First Frame Label)

Jun 21, 2011

I'm incorporating Flash for the first in my site [URL] it should a simple navigation but it has had me stuck for a while. I would like users to click any button on the stage (listed or thumbnails) and open a MC, then close the MC, using a close button , then return to Scene One, which is frame labeled "home".

I am able to successfully open and close the Movieclip but I am not directed back Scene One. When the MC closes, the thumbnail buttons are inactive.

Here is some sample code from The last frame of the MC actions.

stop();
closeVogue_btn.addEventListener(MouseEvent.CLICK, onClickVogue);
function onClickVogue(event:MouseEvent):void
{ gotoAndStop("home");
}

View 1 Replies

Professional :: Can Target The Second Key Frame Of An Empty Movieclip

Apr 24, 2010

Can i target the second key frame of an empty movieclip which is created by actionscript.as for example:this.createEmptyMovieClip("target_mc",1);I want to write some script on the second keyframe on the target_mc movie clip. Is that possible.

View 1 Replies

Flash :: Methods To Objects Inside A Movieclip With Reference To Frame Label/number?

Mar 14, 2011

there is a movieclip named movie with instance name movie.Inside this movie there is a textbox in frame 1.I want to give properties and methods to that textbox.

View 1 Replies

Actionscript 3 :: Change A Frame Label Within A GotoAndStop('label') With The Parameters In A Function?

Feb 29, 2012

Is it possible to change a frame label within a gotoAndStop('label') with the parameters in a function?I'm playing around with updating code as I learn more and more techniques, and at the moment the code is a basic click-a-button to select the object shape, and on press the button disappears:

// Change the object into a circle.
circle_btn.addEventListener(MouseEvent.CLICK,function(){changeShape_fun(circle_btn,circle);});
// Change the object into a square.
square_btn.addEventListener(MouseEvent.CLICK,function(){changeShape_fun(square_btn,square);});

[code]....

However I can't/don't seem to know how to change a frame label through function parameters, or if what I'm trying to do is even possible.Also to note, while I'm all ears for any more efficient ways of doing what I'm trying to do, I would still like to know how/if you can change frame labels through function parmeters.

View 1 Replies

Professional :: Using The Target Path Tool?

Feb 14, 2012

I realise that I need to keep all my code on the main timeline, so now I need some serious help with targeting movieclips and buttons, when I use the target path tool (the little gun sight in the action script panel) it lets me navigate to the thing I want, but when I use it's suggestion it very often doesn't work, and I am left using trial and error to work it out.  Ican get stuff to work, but I really have no idea why or how I am doing it, Sorry to be such a N00B, but I really think if I can work this out I am going to get

View 5 Replies

ActionScript 2.0 :: Specify Target Path Using 'tellTarget'?

May 20, 2004

how do you specify the target path using "tellTarget"?Ex. The target movie clip is on the main timeline but the "tellTarget" script is on another. How would I code this? (or should I just use the standard "gotoAndPlay"?)Is tellTarget really even relevant anymore? It seems to me that with the release of FMX 2004, Macromedia advocates using gotoAndPlay more than tellTarget. Why would you use tellTarget when gotoAndPlay does essentially the same thing (or does it?)?

View 4 Replies

ActionScript 3.0 :: Using Correct Path For (Event.Target)

Jan 8, 2010

Previously it was put as keepLevel1(event.target) at each seperate function. Now I would like to make it frun the functions after an object is successfully loaded. How should I change the (event.target) to?

ActionScript Code:
private function startSearch(event:MouseEvent):void {
var loadID:String;
loadID=searchArea.text;
myLoader2.load(new URLRequest("GetData.aspx?id="+loadID));
myLoader2.addEventListener(Event.COMPLETE,processXML2);
[Code] .....

View 0 Replies

ActionScript 2.0 :: LoadVariablesNum(url,target) Load From Another Path?

Mar 12, 2003

I've got a question about the path of the txt fileI can easily load a txt file in a movie if the txt is in the same folder as de .swf, but when i try to load a txt file from a different levelfor Example projects/com/1.txt i dīn't see any txtthe code is:loadVariablesNum(projects/com/1.txt,0) i know the code is wrong, but can somebody tell me what i have to do to get a txt form a different level.

View 1 Replies

ActionScript 2.0 :: FMX Target Path That Works Both Ways?

May 25, 2003

i have a main-movie with a movieclip called "area", into this movieclip is loaded an external movie.swf

a clip inside this movie.swf has the below script
onClipEvent (enterFrame) {
_level0.area.displayfield = "hello"

[code].....

View 3 Replies

ActionScript 2.0 :: [mx2004] Target Path Woes?

Apr 13, 2005

im attempting to build my first site in flash, and it was all going ok till i decided to get clever!I did have snippets of a.s everywhere, but have been trying to move it all back to frame1 on the main timeline (issat best practice?)the problem im having is that a simple piece of code on a nav button just wont work.when the code was within the same movie as the button it was easy:

btnWelcome.onRelease = function(){
trace ("clicked")
}

[code]....

View 2 Replies

ActionScript 3.0 :: Book And Target Path Icon Wrong?

Feb 10, 2009

I've now found the code:MovieClip(root).square_mc. rotation= 45;Which has solved the problem fantastically.However my book suggests this format:root. square_ mc.rotation = 45; Also, using the 'insert target path' icon in the AS Window gives a similar syntax. eg for the above it gives this.parent.square_mc.orroot. square_ mc.Neither of which work, and generate the following message 1119:Access of possibly undefined property square_mc through a reference with static type flash display: DisplayObject.Am I doing something wrong, or does this style of controlling multiple time lines just not work?

View 2 Replies

Actionscript 3.0 :: Setting A Target Path For A Library | Flash CS4

Jul 9, 2009

I am trying to create a class library in the documents folder on my mac to save reusable .as classes. I tried following the tutorial on gotoandlearn about this, but it doesn't seem to be working out. I set the path in the prefs in flash using the browse button, and then set up the import line in my .fla. When I test, I get errors that say that flash can't find the dir that I am trying to use. Here are some details...

This is the dir structure that I am trying to use to store my classes.

This is how I am trying to link up to the classes using import in flash.

Here is the preference settings that I am using to get flash to look in the dir structure above to find classes to import.

View 3 Replies

ActionScript 2.0 :: Target Path In External SWF Not Working Correctly

Jun 5, 2007

Alright, so I've tried quite a few things with no luck. I have a scrollbar that works in the swf fine, but when loaded into my mainmovie container I get this error...
Target not found: Target = "/scrolling text " Base = "_levelO.swf container"

Basically I understand this to mean that the externally loaded movie cannot find the instance name /scrolling text. The code is as follows that I have set to the scrollbar button in the externally loaded swf....

on (rollOver) {
tellTarget ("/scrollingtext") {
nextFrame();
} gotoAndStop("down1");
}

I tried changing the target to _root.scrollingtext with no luck. Also tried _parent.

View 1 Replies

ActionScript 2.0 :: Enable The Timeline To Automatically Enter A Frame Label On Entering A Certain Frame

Jun 11, 2006

is there an action script code that enables the timeline to automatically enter a frame label on entering a certain frame.

View 1 Replies







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