Actionscript 2.0 clear all movie clips
I need to figure out how, when you roll over a movie clip, it clears all previous clips showing and then plays its clip
eh that may not be possible, but what the set up is each tooltip is its own layer with the clips pasted in.
In each clip theres about 5 layers that are involved with the animate. My code to activate it is
on(rollover){
gotoAndPlay(2);}
that triggers the animation. then theres a simple "close" button that just plays everything in reverse.
Similar Messages
-
Hi,
I have a "map_mc" movie clip that has over 500 movie clips(counties). I also have the countynames in xml format. I want to be able to
1. in a loop get a list of all movie clips
2. and in a dynamic text box assign the county name to the movie clip (from xml).
Is it possible to get the names of all movie clips and then assign the countynames?
I have the xml part semi working and on mouseover can display the name but is stuck on the movie clip part.
I am trying to avoid typing all the county names and in the future will be adding census and other data to the xml.
can someone help?if you had an xmlList of 500 countynames, and if the 500 movieclips inside maps_mc each had names such as mc0, mc1, mc2, etc, you could loop thru them like this:
for(var i = 0; i < xmlList.length(); i++){
//get reference to county movieclip
var mc = maps_mc.getChildByName("mc" + i);
//then add listeners
mc.addEventListener(MouseEvent.ROLL_OVER, overMe);
mc.addEventListener(MouseEvent.ROLL_OUT, outMe);
function overMe(e:MouseEvent){
//the county you rolled over
var mc = e.target;
//extract the number from the name
var n = Number(mc.name.substr(2));
//use n to get countyname from xmlList
var countyname = xmlList[n];
trace(countyname);
//now add countyname to a textField
textField.text = countryname;
function outMe(e:MouseEvent){
//clear textField
textField.text = ""; -
Hi,
Is there a code to remove all movie clip when a button is
press? Sorry. Im new to AShey Scruffy - as I mentioned in your other post it will
depend on how these clips were brought to the Stage to a certain
degree. to be safe one should go ahead and use swapDepths first and
then iterate through all MCs within the swf, as in the following: -
Is there a way to clear ALL event listeners, stop all movie clips, etc?
Is there a syntax for this?
I have a movie that has 15 frames. Each frame has embedded movie clips within movie clips, tons of animations and event listeners. None is needed except when they are on the stage, on the frame. However, the animations continue even when the frame is left.
For instance, I have a frame that has a dynamically rendered animation of leaves falling from a tree. When the frame is left, the leaves continue to fall.
There are many instances of this type of thing happening.
Ideally, I would love to just be able to clear everything when a new frame is loaded, since none of the animations or event listeners need to carry over from one frame to another.
Is there a way to do this without the thousands of lines of code it would take to manually remove every single animation and event listener and sound, etc, from the stage?
Thanks so much!!
Amberyou have to manually do that.
or, you could convert each frame to a swf. load each swf when needed and, if you're publishing for fp 10+, you can apply unloadAndStop() to kill all streams in the loaded swf and ready those assets for gc. -
Disabling all movie clips that are on lower levels
Hello
I have a movie clip that pops up over all other movie clips.
But it is still possible to interact with these movie clips that
are beneath the mc that has popped up. Is there any way to disable
all of the movie clips that are beneath the one that popped up?
thanksTypically the way to do this is simply create a large
invisible MovieClip which covers everything, and give it a an
interactive event. I often use:
on(rollOver){
useHandCursor = false;
This way not only does it steal interaction from anything
below it, it makes it so the cursor doesn't turn into a hand making
the user think there's something clickable.
You could also make a loop which checks getDepth() and if
it's below a specified depth, set enabled = false, but there's
really no reason in doing that. -
Preload ALL movie clips?
I am experiencing a delay or pause in the site when my first
movie of content is played ... A frew frames before the initial
animation is finished I add in :
_root.conten.gotoAndPlay("start1");
to start the home page (or the first page of my content
movie, whatever you want to call it)....
Is this a preloader problem? I just can't seem to iron it
out.
To See It:
http://www.itamidesign.com/new.html
The Code is also here:
http://www.itamidesign.com/new.fla
THANKSno no there's always a way, i was just pointing you in the
direction of the easiest way.
the first thing you need to do is check getBytesLoaded at
regular intervals rather than in a loop on a frame. this can be
achieved several ways - i've used setInterval in the example i
prepared for you.
the second thing you need to do is check that getBytesTotal
has been received from the jpg okay - this can be checked by
ensuring that getBytesTotal>4, which is the size of an empty
movie clip.
the code i have attached is independent of your xml code,
which was really confusing things, as it is unrelated to your
loader code (one problem at a time!). once you're happy with your
loader code, then you can integrate it with your working xml code.
good luck
craig -
TS4455 Why IMovie no longer shows all movie clips from movies from Kodak camera
I am on an IMac 10.6.8 2.16 ghz intel core 2 duo with 3 gb memory
I am using IMovie 11 (9.0.4)
My camera is a Kodak Playsport shooting hd video
On all of over 300 videos I have shot previously IMovie worked perfectly.
On the last 3 movies imported from the camera, I movie loads the preview and I can drag it into the stage but instead of opening up and showing all of the clips, it remains a single image exactly as it displays in the playlist
Nothing I click opens the frames. Thus the only want to edit is to open the file into the fine editing frame
But this is not as easy as it was before where I could see the clip and make the edits right there on the stage.
What has changed? What am I doing wrong?Hello awebstore,
It may be that the view in your Project environment has been zoomed out.
iMovie '11: Resize thumbnail images
http://support.apple.com/kb/PH2121
Hope this helps,
Allen -
GotoAndPlay - refresh all movie clips.
I am trying to create a refresh button using the following code on a button.
on (release) {
gotoAndPlay(2);
This works fine to return to the part of the timeline I want, however because I am using child movieclips with gotoAndPlay, only the main timeline returns to the start, the child movieclips stay as they were.
Is there anyway of getting the whole movie to return to the start?
Many thanks.you must explicitly return everything to the start state or you can reload your swf:
on(release){
loadMovieNum(_root._url,0); -
Casting a 3d movie clip in actionscript
Hello All,
I'm new to flash and actionscripting (i come from the land of ansi c but have traveled extensively). I've created a great animated animated 3d movie clip and want to have them generated on the stage in relation to an xml file. I've gotten this to work with a 2d movie clip but am running into problems casting a 3d object.
my object (a movie clip - boxContainer with an instance name of boxContainer_mc) is built out of all movie clips in the following way (shown in tree form):
boxContainer
-bottomBox
---boxFront
---boxLeft
---boxRight
---boxTop
---shadowFront
---shadowLeft
---shadowRight
---gradientLeft
---gradientRight
---gradientFront
-topBox (this movie clip contains an animation that is controlled through a MouseEvent:Click)
---left
---right
---top
---back
This animates smoothly through flash, but doesn't work when I try to cast the movie clip in actionscript 3 using the following code:
var boxContainer_mc:boxContainer = new boxContainer();
addChild(boxContainer_mc);
When I try to test the swf file I recieve the following errors:
1046: Type was not found or was not a compile-time constant:boxContainer
1180: Call to a possibly undefined method boxContainer
any ideas?If this is a library item that you named boxContainer in the library, you need to designate that name as the linkage ID for the movie. Right click on it in the library, select Linkage from the menu that appears, and in the interface that appears select the Export for Actionscript option (another will be slected automatically). Be sure your Class name appears as you have it coded and click ok.
-
Making movie clips play in reverse in AS 3.0
Hey all. I'm changing all my files to AS 3.0 because of some
new elements I'd like to use in flash CS4.
Here:
http://www.iaw-atlanta.com/IvyLeague1-13-09.html
I have the menu navigation at the bottom with 4 buttons. When the
buttons are moused over they ascend and when they are moused out
the movie plays in reverse so that they descend. Basically in the
movie clip, I have it stopped as well as gotoAndPlay the next frame
when the button is moused over and then have a script telling it to
reverse when moused out. I know how to do this in AS 2.0 but how
can I translate the script to 3.0?DjPhantasy5,
> Ok thanks, I'll see what he also has to say as well.
Actually, NedWebs pretty much nailed it. :) The approach
you've taken
is an interesting one, because it scales all the way back to
Flash Player 5,
which didn't yet support the MovieClip.onEnterFrame event.
Without that
event, you need something like your "controller" symbol -- a
separate
looping timeline -- to perform code that depends on frame
loops.
Available as of Flash Player 6, that event would allow you
to
consolidate your code a bit by putting it all in a single
frame and avoiding
the extra movie clip symbol. That doesn't mean your approach
is wrong, by
any stretch. In fact, it's good to know your options, because
if you ever
need to publish to Flash Player 5, you'll probably do best to
use the setup
you've taken.
I'll demonstrate onEnterFrame in just a bit, in case you
want to take a
look at that.
>> there's no _root reference in AS3, but you can use a
>> MovieClip(this.parent) (which replaces what _parent
>> used to do) to locate something outside of the
immediate
>> movieclip.
The term "parent," in this context, is technically a
property of the
MovieClip class, which means all movie clips in AS3 have
access to the
"parent" feature, which points to the timeline that contains
the movie clip
in question. Buttons also feature a "parent" property. In
AS2, this
property acted exactly the same, only it was preceeded by an
underscore.
In fact, NedWebs' suggested code works the same in your
existin file.
Instead of this:
// Your existing code ...
if (_root.animation._currentframe>1) {
_root.animation.prevFrame();
this.gotoAndPlay(2)
if (_root.animation._currentframe<=1) {
this.gotoAndStop(1);
... you could be using this:
// Alternative code ...
if (_parent.animation._currentframe>1) {
_parent.animation.prevFrame();
gotoAndPlay(2)
if (_parent.animation._currentframe<=1) {
gotoAndStop(1);
... because from this scope -- that is, from this point of
view -- the
MovieClip._parent property points to the same timeline that
_root does.
That changes, of course, based on how deeply nested the
current scope is.
The term "this" in the above code is optional, because Flash
understands
what scope you're in. From the point of view of this code,
_parent is
understood to refer to the current scope's parent timeline,
just like
gotoAndPlay() is understood to refer to the current scope's
own timeline.
You could precede either of those by "this" or not.
Many people will argue that _root is probably best avoided,
only because
it's a slippery slope. It doesn't always refer to the main
timeline you
think it does, depending on whether or not your SWF is loaded
into another
SWF at runtime. Meanwhile, _parent *always* refers to the
immediately
parent timeline.
So when you look at it that way, this perfectly valid AS2:
if (_parent.animation._currentframe>1) {
... isn't much different at all from its AS3 counterpart:
if (MovieClip(parent).animation.currentFrame>1) {
It would be nicer if you didn't need to cast the parent
reference as a
movie clip here, but if you don't, AS3 doesn't realize that
the scope in
question is a movie clip.
>> You can string them along as...
>> MovieClip(this.parent.parent)
Exactly.
>> Your _currentframe in the the controller becomes
>> currentFrame. That's about it. The rest of what I
>> saw will fly as is.
Not quite. AS3 doesn't support the on() or onClipEvent()
functions, so
you won't be able to attach your code direction to the
button. Instead,
you'll have to put it in a keyframe -- which you can also do
with AS2. It's
a good idea, in any case, because it allows you to put all
your code in one
place, making it easier to find.
Here's a quick note on direct attachment:
http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent
To convert your existing FLA structure to AS3, you might,
for example,
do this:
animation.buttonMode = true;
animation.addEventListener(MouseEvent.ROLL_OUT, outHandler);
animation.addEventListener(MouseEvent.ROLL_OVER,
overHandler);
function outHandler(evt:MouseEvent):void {
controller.gotoAndPlay(2);
function overHandler(evt:MouseEvent):void {
controller.gotoAndPlay(4);
That takes care of the on(rollout) and on(rollover) code in
your current
version. The first line (buttonMode) is only necessary
because I got rid of
the button symbol and, instead, associated the event handlers
directly with
your animation clip. (Movie clips handle button-style events,
too, so you
don't need the button.) In AS3, event handling is very
straightforward:
you reference the object (here, animation), invoke its
inherited
addEventListener() method, then pass in two parameters: a)
the event to
listen for, and b) the function to perform when that event
occurs.
You can see that spelled out above. In AS2, there are quite
a few ways
to handle events, including on()/onClipEvent(), so it's
harder to know when
to use what approach. For buttons and movie clips, the
princple works the
same as I just showed, but the syntax is different.
Let's take a quick look at reducing all this code by using
the
onEnterFrame event. First, check out this AS2 version:
animation.onRollOut = outHandler;
animation.onRollOver = overHandler;
function outHandler():Void {
this.onEnterFrame = reversePlay;
function overHandler():Void {
this.onEnterFrame = null;
this.play();
function reversePlay():Void {
this.prevFrame();
All of that code would appear in frame 1. You don't need the
controller
movie clip. The animation clip no longer contains an orb
button, because
we're using animation itself as the "button". (You can always
see what
functionality any object has by looking up its class. If
you're dealing
with a movie clip, look up the MovieClip class. See the
Properties heading
to find out what characteristics the object has, see Methods
to find out
what the object can do, and see Events to find out what the
object can react
to.)
In the above code, it's all laid out pretty easily. This is
AS2,
remember. We have two events we're listening for:
MovieClip.onRollOut and
MovieClip.onRollOver. Those events are established for the
animation movie
clip by way of its instance name, and associated with
corresponding custom
functions. The outHandler() function associates yet another
function to the
MovieClip.onEnterFrame event of the animation clip. Very
simply, it
instructs animation to perform the custom reversePlay()
function every time
it encounters an onEnterFrame event. The overHandler()
function kills that
association by nulling it out, and telling animation to play,
via the
MovieClip.play() method. Finally, the reversePlay() function
simply invokes
MovieClip.prevFrame() on the animation clip.
Here's the AS3 version:
animation.buttonMode = true;
animation.addEventListener(MouseEvent.ROLL_OUT, outHandler);
animation.addEventListener(MouseEvent.ROLL_OVER,
overHandler);
function outHandler(evt:MouseEvent):void {
animation.addEventListener(Event.ENTER_FRAME, reversePlay);
function overHandler(evt:MouseEvent):void {
animation.removeEventListener(Event.ENTER_FRAME,
reversePlay);
animation.play();
function reversePlay(evt:Event):void {
evt.target.prevFrame();
It looks wordier, but if you look carefully, you'll see that
it's
essentially the same thing. The main difference is the way
scope works in
AS3. In AS2, there are numerous references to "this", because
the event
handler functions operate in the same scope as the object to
which the
association is made. In AS3, the references aren't to "this",
but rather to
the same animation clip by its *intance name*, because in
AS3, the scope
operates in the same timeline in which the code appears
(namely, in this
case, the main timeline).
In the reversePlay() function, in order to emulate a "this"
sort of
setup, I'm referring to the parameter that gets passed to all
event handler
functions in AS3. I happened to name it "evt" (for event),
but you can call
it what you like. In the case of reversePlay(), the evt
parameter refers to
an instance of the Event class, which has a target property.
The target
property refers to the object that dispatched the event --
happens to be
animation, in this case. So evt.target, in this context,
refers to
animation, which is what I invoke the MovieClip.prevFrame()
method on.
I've uploaded a handful of FLA files to my server. I won't
keep them
there forever ... maybe a couple weeks, as of this post:
http://www.quip.net/RewindTestAS3.fla
http://www.quip.net/RewindTestAS3_new.fla
http://www.quip.net/RewindTestAS2_new.fla
David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/2s28a5
"Luck is the residue of good design." -
Targeting Multiple Movie Clips
Hi everyone,
I'm fairly new to ActionScript so I would really appreciate
any help I can receive.
Right, I have a Flash file which contains a movie clip with
an instance called, 'contentHold_mc'. Inside this movie clip are 4
individual movie clips with instances entitled, 'content1_mc',
'content2_mc', 'content3_mc' and 'content4_mc'. I know these are
not the best names for instances, but this is just for simplicty's
sake. At present all movie clips run at the same time. I want them
to run sequentially. On the last frame of the instance,
'content1_mc', I want to stop the instance from playing and start
playing the instance, 'content2_mc'. On the final frame on
'content3_mc', I want to stop the instance from playing and start
playing the instance, 'content3_mc', and so on until 'content4_mc'
finishes playing. I have tried to use the tellTarget function
without success and anyway, I believe this is now deprecated.
Would anybody be able to provide me some guidance please as
to how I can achieve the previous using the 'dot' notation?
I have tried the using the code found at the bottom of this
message in the final frame of the movie clip instance that I want
to play first ('content1_mc'), however get a compiler error because
of the preceding two full stops '..'
Thank you in advance for any help I may receive with this
query.Put a stop(); command at the first frame of each of the
clips. On the last frame of the first clip put:
stop();
_parent.contentHold_mc.content2_mc.play();
repeat as needed for each movie clip.
Tell the first clip to play. -
Dynamically adding multiple instances of a movie clip to the stage with one button
hello,
I was wondering if there was a way to add several instances
of the same movie clip to the stage dynamically utilizing one
button.
I can do one with the following code placed on the button...
on (release) {
attachMovie ("filledCircle", "filled1", 5);
filled1._x = 370;
filled1._y = 225;
But I want the user to be able to hit the button again and
get yet another instance of "filledCircle" on the stage.
I also want the user to be able to drag these instances
around...
Any help would be appreciated...
Thanks,
MuhlMuhl,
> I was wondering if there was a way to add several
> instances of the same movie clip to the stage
> dynamically utilizing one button.
Sure thing.
> I can do one with the following code placed on the
> button...
>
> on (release) {
> attachMovie ("filledCircle", "filled1", 5);
> filled1._x = 370;
> filled1._y = 225;
> }
Gotcha.
> But I want the user to be able to hit the button again
> and get yet another instance of "filledCircle" on the
> stage.
You're in luck, because this isn't very hard to do. The main
thing to
keep in mind is that each instance must have A) its own
unique instance name
and B) its own unique depth. In your example, the instance
name is filled1
and the depth is 5. The next clip's instance name should be
filled2 at a
depth of 6. Then filled3, depth 7, and so on. You can use a
single
variable to handle the incrementation.
// code in a frame
var counter:Number = 1;
// code on your button
on (release) {
attachMovie ("filledCircle", "filled" + counter, counter +
4);
With me so far? The variable counter contains the numeric
value 1. The
second parameter of attachMovie() is provided with a
concatenation of
"filled" + 1, which makes "filled1". The third parameter is
provided with
the sum of counter plus 4, which makes 5. Obviously, we need
a bit more.
The button must, in addition, increment the value of counter.
The ++
operator handles this perfectly.
on (release) {
attachMovie ("filledCircle", "filled" + counter, counter +
4);
counter++;
Now, it seems you also want to position the attached movie
clip to (370,
225). Are they call supposed to go to the same place? If so,
you may use a
second variable to hold a reference to the newly attached
clip. Look up
MovieClip.attachMovie(), and you'll see that the method
returns the exact
reference you need.
// code in a frame
var counter:Number = 1;
var mc:MovieClip;
// code on your button
on (release) {
mc = attachMovie ("filledCircle", "filled" + counter,
counter + 4);
counter++;
mc._x = 370;
mc._y = 225;
Make sense?
> I also want the user to be able to drag these instances
> around...
Then you need to handle a few events. You're dealing with
movie clips
here, so your best bet is to study up on the MovieClip class,
which defines
all movie clips. (Note, also, that the TextField class
defines all input
and dynamic text fields; the Sound class defines all sounds,
etc. This is a
very handy arrangement of the ActionScript 2.0 Language
Reference.)
// code in a frame
var counter:Number = 1;
var mc:MovieClip;
// code on your button
on (release) {
mc = attachMovie ("filledCircle", "filled" + counter,
counter + 4);
counter++;
mc._x = 370;
mc._y = 225;
mc.onPress = function() {
this.startDrag();
mc.onRelease = function() {
this.stopDrag();
Easy as that. You're simply assigning a function literal to
the event
of each new MovieClip instance as you create it. Take a look
and you'll see
each of these class members available to you -- that is, to
all movie clips.
MovieClip.onPress, MovieClip.startDrag(), MovieClip._x, etc.
Wherever it shows the term MovieClip in the Language
Reference, just
replace that with the instance name of your clip -- or a
reference to that
clip (which even includes the global "this" property).
David
stiller (at) quip (dot) net
Dev essays:
http://www.quip.net/blog/
"Luck is the residue of good design." -
Hello Folks,
i want to learn how to use Actionsscript 3.
As practice i tried to build the controls Play, Stop, Rewind,
FF and Jump for a simple tween with no continous loop.
But soon i got stuck with the rewind function. The
ENTER_FRAME Event that is needed for an automatic rewind interfere
with the rest of the functions. I think the problem is that the
ENTER_FRAME EventListener is active from the beginning, but it
should be only active if rewind is active.
I got the Idea for the rewind from
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm
Chapter: Programming ActionScript 3.0/Working with movie
clips
My Script so far:
//Let not start the animation automaticly.
box_mc.stop();
//Eventlistener for the Buttons. Over!
play_btn.addEventListener(MouseEvent.MOUSE_OVER,
playAnimation);
rewind_btn.addEventListener(MouseEvent.MOUSE_OVER,
rewindAnimation);
//EventListener for the Buttons. Out!
play_btn.addEventListener(MouseEvent.MOUSE_OUT,
playAnimation);
rewind_btn.addEventListener(MouseEvent.MOUSE_OUT,
rewindAnimation);
//Eventlistener for a continious rewind
box_mc.addEventListener(Event.ENTER_FRAME, rewindAnimation);
// Function for the Play Button. Stops at the last frame.
function playAnimation(event:MouseEvent):void {
box_mc.play();
if(box_mc.currentFrame == totalFrames){
box_mc.stop();
// Function for the Rewind Button. Stops at the first frame.
function rewindAnimation(event:MouseEvent):void {
box_mc.prevFrame();
So all tips getting around this are welcome.
Thank you.many thx
that worked out! :)
//Let not start the animation automaticly.
box_mc.stop();
//Eventlistener for the Buttons. Over!
play_btn.addEventListener(MouseEvent.MOUSE_OVER,
playAnimation);
rewind_btn.addEventListener(MouseEvent.MOUSE_OVER,
rewindAnimation);
//EventListener for the Buttons. Out!
play_btn.addEventListener(MouseEvent.MOUSE_OUT,
stopAnimation);
rewind_btn.addEventListener(MouseEvent.MOUSE_OUT,
stopAnimation);
// function for the Play Button. Mouse_Over
function playAnimation(event:MouseEvent):void {
if (box_mc.currentFrame != box_mc.totalFrames) {
box_mc.play();
box_mc.addEventListener(Event.ENTER_FRAME, stopAtLastFrame);
// function for the Rewind Button. Mouse_Over
function rewindAnimation(event:MouseEvent):void {
box_mc.addEventListener(Event.ENTER_FRAME, oneFrameBack);
// function for stopping. Mouse.out
function stopAnimation(event:MouseEvent):void {
box_mc.stop();
box_mc.removeEventListener(Event.ENTER_FRAME, oneFrameBack);
// function for Stoppimg at the last frame
function stopAtLastFrame(event:Event) {
if (box_mc.currentFrame == box_mc.totalFrames) {
box_mc.stop();
box_mc.removeEventListener(Event.ENTER_FRAME,
stopAtLastFrame);
//function for going one frame back
function oneFrameBack(event:Event):void {
if (box_mc.currentFrame == 1) {
box_mc.removeEventListener(Event.ENTER_FRAME, oneFrameBack);
} else {
box_mc.prevFrame();
} -
Playing a Movie Clip within a Movie Clip on load
Hi,
I'm trying to play a Movie Clip animation that is within a Movie Clip after a button has been pressed in a different Movie Clip.
The issue is that all Movie Clip animations are playing as soon as the SWF is loaded.
I have a separate Main.as file that contains all of the coding except for the animation stops:
package
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Main extends MovieClip
var title1:Title1;
var scene1:Scene1;
var scene2:Scene2;
var scene3:Scene3;
var scene4:Scene4;
var scene5:Scene5;
var scene6:Scene6;
var scene7:Scene7;
var scene8:Scene8;
var scene9:Scene9;
var scene10:Scene10;
public function Main()
title1 = new Title1();
scene1 = new Scene1();
scene2 = new Scene2();
scene3 = new Scene3();
scene4 = new Scene4();
scene5 = new Scene5();
scene6 = new Scene6();
scene7 = new Scene7();
scene8 = new Scene8();
scene9 = new Scene9();
scene10 = new Scene10();
addChild(title1);
title1.buttonStart.addEventListener(MouseEvent.CLICK,onButtonStartClick);
scene1.buttonWalkOutside.addEventListener(MouseEvent.CLICK,onButtonWalkOutsideC lick);
//title
function onButtonStartClick(event:MouseEvent):void
addChild(scene1);
removeChild(title1);
Scene1(parent).gotoAndPlay("frame1")
//scene1
function onButtonWalkOutsideClick(event:MouseEvent):void
addChild(scene2);
removeChild(scene1);
So right now, I'm getting this error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@46534041 to Scene1.
at Main/onButtonStartClick()
Any help is greatly appreciated... I've been grinding at this all night.I had been trying a bunch of different methods after searching for clues on Google, so it probably doesn't make sense with the parent.
I replaced the code with what you wrote, and I am given this error now:
Main.as, Line 44
1120: Access of undefined property scene1Text1.
Is there somewhere I have to declare scene1Text1 in Main.as? -
How to link from a movie clip to main timeline?
My problem first appeared very simple, but I have spent a
while on it and can't think how to solve it. I must say that I am
very much an amateur in designing in Flash and ActionScript.
I created a movie clip containing an embedded video and a
sound clip. In the main timeline I inserted the movie clip into a
keyframe. When I found the movie clip didn't play, I discovered
that the only way of making it play was to place a Stop action in
the keyframe of the movie clip, and also set the whole movie to
loop. The Stop action stopped the whole movie from looping, but
instead made the movie clip loop. If the keyframe is on frame 456,
how do I make it advance onto frame 457 once the movie clip has
finished running?
I've tried various ways around the problem, including placing
a button inside the movie clip to Go to and Play frame 457, but
instead it plays frame 457 in the movie clip.
Can anyone help me with this please?Hello,
You need to tell flash the "target" you want to play. If not
specified
it will think it is the target you are calling from which in
your case
is the movie clip.
So to go back and play one level up would be:
_parent.gotoAndPlay(457);
If the movie clip was inside another movie clip then it would
be:
_parent._parent.gotoAndPlay(457);
or you can just referent the root of the movie directly:
_root.gotoAndPlay(457);
Search the help file for timeline target and you should find
more about it.
Incubusguy wrote:
> My problem first appeared very simple, but I have spent
a while on it and can't
> think how to solve it. I must say that I am very much an
amateur in designing
> in Flash and ActionScript.
>
> I created a movie clip containing an embedded video and
a sound clip. In the
> main timeline I inserted the movie clip into a keyframe.
When I found the movie
> clip didn't play, I discovered that the only way of
making it play was to place
> a Stop action in the keyframe of the movie clip, and
also set the whole movie
> to loop. The Stop action stopped the whole movie from
looping, but instead made
> the movie clip loop. If the keyframe is on frame 456,
how do I make it advance
> onto frame 457 once the movie clip has finished running?
>
> I've tried various ways around the problem, including
placing a button inside
> the movie clip to Go to and Play frame 457, but instead
it plays frame 457 in
> the movie clip.
>
> Can anyone help me with this please?
>
>
Maybe you are looking for
-
Burn DVD and it has a sign on that says 3ivx Trial why??
I did an update two days ago but I didn't check the details.. I don't know if maybe that cause whats happening. I burn my dvd as always but when I put it to see it, it has a big red sign on it that says 3ivx Trial. Why is that?? How I can get rid of
-
i burned a dvd yesterday and popped it out, and now the tray on my SONY DVD RW DW-D150A superdrive will not retract. it goes in about 1/2" before it stops, and then comes back out again. the eject commands / key all work still, but the tray physicall
-
Foreign Exchange difference posted to price difference account at MIGO
Hi, We have a problem regarding posting foreign exchange rate difference at the time of GR. We are costing materials at the beginning of year, and purchases made during the year as per PIR will result in legitimate price difference which is posted to
-
Exchange server 2013 proxy authentication
Hi All, I wanted to know what is the recommended proxy authentication for exchange server 2013. I have observed the following from different proxy authentications: 1. Negotiate: By default, the proxy authentication is set to negotiate and uses anony
-
When I plug my unit into my computer via the usb all I get is the spinning wheel and the please wait battery very low message. However, when it is plugged into the wall it shows the charging icon and becomes operational (meaning I can use it as norma