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
Similar Posts:
Jul 23, 2009
got a movie clip with a fairly complex timeline animation. At the end of the clip I need the entire mc to move and scale to a specific location. Unfortunately, the first frame of the mc (the poster frame) is just solid black, the elements I really need to align are on the last frame of the mc (near frame 435). Is there a way to display an arbitrary frame of a mc on the main timeline for authoring purposes?
View 2 Replies
May 15, 2003
I need to play different movie clip at a given frame, let's say 100, in the main timeline. For example,
if(_root.x==1) play movieClip1;
else if(_root.x == 2) play movieClip2;
else if(_root.x == 3) play movieClip3;
How can I do it?
View 1 Replies
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Jan 28, 2011
So i have multiple swf's that are within a stage. The main swf (index.swf) has a menu and once clicked it makes another swf to display. A common issue i'm having is that for the other swf's. I have animations which work within that swf but when i run from index they don't work.I know this is because of the targeting of the object but how do make this work?ample on 5.swf i have a button that has an action, when a mouse cursor goes over it a photo fades in and out on it, and that works when i run 5.swf
View 9 Replies
Nov 11, 2003
what is the syntax of targeting a scene from one swf to another? lets say i have a 2 swf file and i want to target a scene frm the second swf file named "games". tnx
View 14 Replies
Oct 5, 2004
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
Jun 15, 2009
I have a small problem with dynamic targeting inside a loop. Shortly, I have some buttons which I add listeners to in a loop. loop works fine. I got everything to work, but the second line in it gives this error : TypeError: Error #1034: Type Coercion failed: cannot convert []@d4abe81 to Function.[code]Can anyone help me with the correct syntax for the second line ?
View 1 Replies
Oct 28, 2009
I have a text input field. When I press on it I'd like something to happen. But it doesn't seem like I can target the input field like this.
myTextInputFieldName.onPress = function {
do something
}
I tried putting it inside another movieclip (which I can target), but then the text input cursor goes away and I can no longer access the input text box. I know there is probably a simple solution but I can't figure it out.
View 5 Replies
May 18, 2009
The site has 6 pages: home, contents, contact, about, showreel, corporate. I have a panoramic photograph as a background across all my pages. When a button,such as contact, is clicked the timeline is enabled and scrolls across the panoramic to the 'contact' area of the photograph.I have a few questions relating to how I can achieve this. 1.) On my actions layer I have this code on frame one: stop(); enter_site_btn.addEventListener(MouseEvent.CLICK, buttonCLicked); function buttonClicked (event:MouseEvent):void { play(); } So when you mouseClick the timeline plays and goes to the next stop point on the timeline which is the contents section. On the contents page are the buttons which lead to the other sections. So far I have this code: stop(); about.btn.addEventListener (MouseEvent.CLICK,buttonCLicked) corporate.btn.addEventListener
(MouseEvent.CLICK,buttonCLicked) showreel.btn.addEventListener (MouseEvent.CLICK,buttonCLicked) contact.btn.addEventListener (MouseEvent.CLICK,buttonCLicked)
Each of the buttons work, but I want the timeline to play and go to the page which corresponds to the button which is clicked, not just to play the timeline until the next stop point. Is there a code which would enable the timeline to play and go to the correct section, and not just roll without a target? 2.) I also want to be able to write a code which enables the timeline to move to any section in the same amount of time. What I mean by this is that if it takes 2 seconds (48 frames) to go from the first section to the second section, I also want it to take 2 seconds to go from the second section to the sixth section (240 frames)
View 40 Replies
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
Jan 8, 2010
I am trying to set up a global variable. On the root of my timeline, I have this;
_global.floorVar = "0";
trace(floorVar);
which seems to trace fine to say 0.
Then, inside of a movie clip on the main timeline, I have a button function:
floor1.onRelease = function() { _global.floorVar = "1"; trace(_global.floorVar) _root.gotoAndStop(2);};
if (_global.floorVar == 1) { trace("it works");
}
It traces as 1 once I press the button, but the if statement doesn't trace "it works" is my global variable set up wrong?
View 7 Replies
Feb 7, 2010
Basically, I have a main .swf, into which I am loading another .swf using loadClip(), on the click of a button. It loads into an empty movie clip on the timeline of the main .swf called container_mc. So far so good, this works.
The problem comes when I am trying to control a movie clip that lives on the timeline of the external .swf. This clip has the instance name test_mc, and I'm trying to control it using the reference _level0.container_mc.test_mc. I have also tried just plain old container_mc.test_mc.
Neither of these work, though when I apply a trace to test_mc with Actionscript on the timeline of the external swf (test_mc.onRelease = function () { trace(this); }), it returns the path _level0.container_mc.test_mc (when clicked on after being loaded into the main movie, obviously).
View 5 Replies
Feb 9, 2010
I'm loading an external swf into a project and I want to be able to start and stop the loaded swfs timeline at will.... I'm loading swf into an MC: loadMovie("myFile.swf", swfHolder_mc);
View 1 Replies
Feb 17, 2010
Imagine I have an swf file on an html page. Beneath it I have a div called "container". I would like to hit a button in the flash file and have the contents of the container div change. I've done a similar thing with frames or iframes in the past, but I'm thinking there is a way to tell flash what div I am targetting.
View 1 Replies