Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Load Clip Before Frame Actions



Dear Colleagues,

In one frame I have 8 clips. On the frame itself I am calling a function inside the clips. The problem (I believe) is that the frame actions are called before the clip is loaded. How do I verify that the clips are loaded before the frame action is called?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 04-02-2007, 03:48 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] Stopping Actions After A Frame Is Reached On A Movie Clip
Me again. This time what I'm tyring to do is to prevent an action from happening once a certain frame within the movieclip is reached. For example:

When the movieclip button is moused over, the size/alpha of the movieclip changes, for 4 times, up to 100%. Then after this I want to disable the function from being able to run. The code currently running is:

kick1.onRollOver = function() {
tellTarget (kick1) {
this.nextFrame()
}
};

So when the clip reaches frame 11, I want to stop the user from being able to use the function above. Do I need an if statement? i.e:

If kick1.framenum >=11,
kick1.onRollover = null?

Or does it need to be rooted/have a this statement in the code to function?

Cheers.

Load A Frame From Movie Clip?
I don't really know what I'm doing...I have this flash website. There's a main box for all the text and images, and to the right of that is a scollPane component with mc's in it. I have buttons in the mc, inside the scollPane. My question is, how do I get the buttons in the mc to load something inside that main box with the images and text?

How To Load A Clip Stopped On Its Last Frame
Hi, everybody!
I'm in trouble with this:
I have an empty movieclip (that I called "sequence") in which I'm loading several SWFs to play them one after another.

And now I need my presentation to be "playing-back rewindable" by press-holding a "back" button and just release it to stop when I want it so.

But, when the current movieclip (003.swf) gets its first frame, I need to go to the previous one's last frame (002.swf's last frame) and the same should happen when 002.swf playsback until "001.swf" shows its last frame.

Every SWF changes two variables called "theprevious" (with a number to identify the previous swf) and "thenext" (with a number to identify the next swf to be loaded). I expected them to be useful to achive my pusposes.

This was suppose to be simple but the results have been very disapointing!

I'm an apprentice about all this Flash stuff. Somebody save me!

I think I just need to know how to invoque the a previous swf stopped on its last frame.

Very much thanks in advance!

Actions On Clip Kill Parent Actions? Workaround?
Hello, i have a nav clip, with rollover actions. When the nav clip is rolled over, i want the nav to zoom in. Which isn't a problem,
there are 6 buttons inside the nav clip which have onRelease actions. However, since the nav clip (the parent to the buttons clip) has the rollover state, it kills the actions of the buttons. Is there a workaround for this?

here is my code, the clip structure is nav.buttons.but1 etc.

code:
Stage.scaleMode = 'noScale';
import flash.filters.*;
//------------------------------------------------------------------------------------------------------------------
this.nav.onRollOver = function() {
};
this.nav.onRollOut = function() {
};
//------------------------------------------------------------------------------------------------------------------
for (i=1; i<=6; i++) {
nav.buttons["but"+i].onRelease = function() {
trace(this._name);
};
}

Load Movie Clip And Jump To A Specified Frame ?
hello.

whow can I jump to a specified frame or label in a new
loaded movie clip.
I want to load the new clip from a different navigation
clip, but I can not just tell him, hey load "kit.swf" and
go to label "god", no?

sure very easy, but not for me.

? (with flash 5)

thomas garcia godines

Load Movie Into Holder Clip Not On Frame 1
Okay, here is the situation. I have a MovieClip, call it a_mc which has its
own class file. In it are several additional MovieClips, some with, and
some without class files. One in particular, call it b_mc, has a class file
and is used as a holder for several additional MovieClips. One of those is
an empty MovieClip with an instance name, call it holder_mc. However, b_mc
stretches over 100 frames, and holder_mc does not appear on a keyframe until
frame 30.

Now, I have a method in the class file for a_mc that uses a MovieClipLoader
to load a thumbnail into holder_mc, so the call to load the clip looks like
this
my_mcl.loadClip(filePath, b_mc.holder_mc);

Now, this does work... but only intermittently, and only about 5% of the
time. Since I am from a programming background and never really learned
actionscript in a multi-frame environment I have a feeling it is because the
frame has not been reached with the holder_mc MovieClip when the call to
load is executed. Everything I do is always in a single frame even though I
know that is not taking full advantage of stuff you can do with Flash.

My solution was to make a copy of holder_mc and place it on the first frame
off the stage (figured it was better than making 0 alpha for processing
sake) and that took care of the problem.

But, is this the only way to do this? Or would I have to do something like
put my call to loadClip in an onEnterFrame that is checking to see if frame
30 has been reached, then loading the picture into it?

Thanks for any insight.

Load External Movie Clip At Certain Frame
Hi.
I'm loading a clip into an empty container clip.
How do i get the external clip to begin playing at a certain frame?
Thanks.

Load Movie Clip When Reach Frame (Important)
Hey everyone!
this is really simple but i don't konw the code: i want to be able to load a movie clip (Home.swf) in a main movie clip once a certain frame has been reached. All i need is the code at the beginning to tell it to do something once that frame has been reached (not the entire code).

Thanks alot!
Matt

Frame Actions Vs Object Actions
In preparation for AS3 which no longer supports object actions, I am on the process of converting flash movies created with Object actions in AS2 to Frame actions. While I understand some valid reasons for switching to Frame actions, I am discovering that converting button and clip actions to Frame actions is a very tedious process and so far, more than half the files I have tried to convert do not work. Having worked with Flash since version 3, I know about timelines, targeting and variable scope but this whole conversion process is driving me nuts! Is there a place that I can go to or tutorials available that teach how to attack this conversion? What are the main guidelines in converting from Object to Frame Actions? I have looked in the CS3 Help (from the program or Adobe online) and I have not found anything to guide me. Am I the only one experiencing this? Thanks for your help.
Yvan

Object Created In A Frame's Actions Telling Parent Frame To Delete It?
I've got an object (an instantiation of my own class that extends Sprite) being created in the actions for a frame, like this:


Code:
import Scripts.CFoobar;

var foobar:CFoobar = new CFoobar();
addChild(foobar);

stop();
CFoobar then creates and manages some buttons, etc. At a certain point, CFoobar knows it's time has come, and it wants to be deleted, and have the frame go to another frame.

What's the best way to have it do this?

(mx) Transfering Actions Which Load With Movie To Load When Button Is Pressed
hi,

I have some code which draws a line when the mouse is pressed (to when it is released)

This code is within an object, loads when the movie starts and works fine:


Code:

// ***** Set some opening parameters
onClipEvent (load) {
// Make original line invisible
_root.line._visible = 0;
// Initiate some variables
number_lines = 0;
line_active = 0;
}
// ***** Every time the mouse button is released...
onClipEvent (mouseDown) {
// Get the position of the mouse
origin_x = _xmouse;
origin_y = _ymouse;
// Increase the number of lines by one
number_lines++;
// Generate a new line name
name = "line"+number_lines;
// Duplicate a new line
_root.line.duplicateMovieClip(name,number_lines);
// Position the line's end point at mouse position
_root[name]._x = origin_x;
_root[name]._y = origin_y;
// Update line length / orientation
_root[name]._xscale = _root._xmouse - origin_x;
_root[name]._yscale = _root._ymouse - origin_y;
// If this is the start of a new shape
if (!line_active) {
// Set the line tracking variable
line_active = 1;
// Set the start point of the new shape
start_x = origin_x;
start_y = origin_y;
}
}

onClipEvent (mouseUp) {
line_active = 0;
}

// ***** Every time the mouse is moved
onClipEvent (mouseMove) {
// If there's a line currently being drawn...
if (line_active) {
// Update line length / orientation
_root[name]._xscale = _root._xmouse - origin_x;
_root[name]._yscale = _root._ymouse - origin_y;
updateAfterEvent();
}
}
I want the user to press a button before this code is usable - just as with any drawing program.

How do i go about telling the code only to start when the button has been pressed?

thanks,

jeff

Assign Actions To Both Parent Clip And Child Clip?
Hello, i need to find a way to add actions to both a parent and child clip.
I ultimately need the entire nav to zoom in when rolled over, and the clips inside the nav have an onRelease function assigned. Any suggestions?

Frame Actions
I am having trouble getting frame actions to work in Flash 5. I have 3 movies all with the same frames except with change in text. The first movie has two scenes. All three movies are going to play at the same times. Except that movie 1, at the last frame, in scene 1 is suppose to go to and play scene 4, frame 1, and at the end of the last frame for scene 4, it is suppose to go to and play current scene, frame 1. This does not happen. The movie just stops and the frame actions are not activated. Please help.

Help With Frame Actions
Basically I'm trying to make some drawers in a box go in and out.

When you click on one drawer, it slides out.
Then when you click on the another drawer it will open, and the one that was open closes.
Each drawer is a button inside of a movie clip. and the movie clip has the open and close animations.
The open animation starts on frame 2 of each drawer movie, and ends opening on fram 8. Then the closing animations starts on frame 9 and will go to and stop on Frame 1.

this is the code I was using:

on (release) {
gotoAndPlay(2);
if (_root.box.drawer1, 8){
_root.box.drawer1.gotoAndPlay(9);
}

My guess was like using the ifFrameLoaded script, though that only works for Preloaders, so I tried something like you see above. I'm trying to say that if the drawer1 movie is on Frame 8, then when you click on any other drawer it will play the close animation. And if the drawer1 is not on frame 8 then nothing will happen when you click on other drawers, except that the drawers you click on will do their own opening animation themselves. Make Sense?
Anyways.. the problem I am having is with this code, when I click on a another drawer that has this code in it.. and drawer1 is closed, it opens with the other drawer I clicked on.
So, yeah.. anyways.. any help would be great!!

Frame Actions...
Frame Actions:

I am currently making a game, called Rancher. Every thing goes fine untill you reach the loaction of which the flash program randomly selects a monster for you. It's all fine and dandy, then when you go back to the town the monsters not there!

In the frame actions in the Town Scene I have this:

_root.hare._visible = 0;
_root.Naga._visible = 0;
_root.wolf._visible = 0;
_root.dino._visible = 0;
_root.Golem._visible = 0;
_root.Suezo._visible = 0;

In the button actions in which it is in the scene of the monster cut-scene at the end of it I have this:

on (release) {
gotoAndStop("Town", 1);
_root.Naga._visible = 1;
}

In _root.Naga._visible = 1; Naga is for all the other monsters up there, I didn't want to spam this thread with same AS just differnt names.

Me my self, I thought it was the frame actions, If any one else knows why this is happening; Please let me know.


Thanks in advance

Frame 1 Actions Bypassed
I've noticed that very often, if you gotoAndStop(1) that certain ActionScript calls (such as stop()) are sometimes ignored, and the movie will play from that point, for example. I remember someone else referring to this once as a bug in Flash (even back in ver. 4), but never read anything very definitive about it.

Can someone point me in the right direction? my guess is that there's a technote on MM's support site about it, or some posts on the more popular forums, like were-here, but I'm not really sure what to try searching for.
[Edited by verto on 11-21-2001 at 08:00 AM]

Sound And Frame Actions
I am having real problems.
I have a long sound (a song) in a mc called sound on the main timeline. The main timeline loops whilst the sound plays.
I want to break the loop when the sound is finshed.

I have put the following on the a frame at the end of the sound mc before the very last one.

_root.gotoAndPlay(261);

but it seems to ignore it completely I have set the sound to be 'stream'

Anybody any suggestions?

Assigning Actions To First Frame
Newbie here, just wondering how to assign an action to the first frame which makes the movie play, then when it gets to frame 40, it stops to wait for user input. If it makes a difference, i will be using a preloader which has yet to be made/intergrated. Do I just assign an action that instructs goto and play frame one, and add another action that says stop at aforementioned frame? Any assistnce would be appreciated. This forum has been of great assistance to me, I hope to find results to this quandry...

Q

Problems With Frame Actions
I'm lost with frame actions,
I want to build a slide bar to scroll text.
Why if I write the following on frame #1
I get an error (script slowing down your system)
---------------------------------
if (movie._ymouse == previouspos)
gotoAndPlay(1);
else
nextFrame();
--------------------------------

Problems With Frame Actions
I'm lost with frame actions,
I want to build a slide bar to scroll text.
Why if I write the following on frame #1
I get an error (script slowing down your system)
---------------------------------
if (movie._ymouse == previouspos)
gotoAndPlay(1);
else
nextFrame();
--------------------------------

How Do I Repeat Actions In A Frame
hello
sorry for being stupid
i made some variables equals something
such as:

x= y
y= math.w/e(blahblah)

but what i want it to do is keep changing,
i see the script

if(i=0; i<this; i++)
how does that work?
if anything will that work?

How Do You 'unload' Actions Before You Get To The Next Frame?
I am having issues with the same dynamically loaded images and text staying on the screen when I get to the next frame. How do I get these to go away when I get to the next frame?

I am using _root.createTextField and _root.createEmptyMovieClip to load text and an image to the screen. I have actions on each frame, one right next to the other, but I have different actions on each frame.

Thank you!

Should All Actions Go On The Same Layer Frame?
1.) If I need to apply a stop action and actions for a button on frame 1, should these be placed on different Action layers? So a Frame Actions layer and a Button Actions layer?

2.) If there are multiple buttons on the same frame, should a separate layer be created for each button action that will need actions applied to it?

Thank you.

Need Some Help With Frame Actions/behaviors
The dimension of my flash file is around 850 by 800, so it is a little too big for most screen sizes. The problem I am having however is that I want each frame to start back at the top. When I click on the next button or previous button, it shows the frame in the same orientation as the previous one. Any help please?

Repeating Frame Actions
How do make it so that the actionscript on a stopped frame repeats itself instantly over and over again, kind of like with OnClipEvent (enterFrame) although that only works for movie clips and I want to have the actionscript on the frame?

And does anyone have any idea of what framerate flashstuff on a nice website should have?

Frame Label Actions
Does anybody know if there are any commands which relate to frame labels?

Such as:

Finding if a specific frame has a label and its name.

or

returning an array of a movieclip's frame labels




????

Position Of Actions Frame
Hi this sounds like a stupid question but i've farely new to flash.
I've always thought you put the frame with all your actions in it on the top layer in the 1st frame.

I've discovered these actions won't affect for example a Movie clip that doesn't come in until frame 10.
But if i put the actions for the clip in frame 10 then it works for that clip.

Do your actions have to always be at the frame where your object begins in the timeline?

Shouldn't the actions just cover the whole movie?

Any help would be great..
Thanks guys & gals.

Actions Based On MovieClip Frame
I am trying to set up a script where a button on the main timeline targets a clip, but depending on the current frame of the clip's timeline, it will trigger to a different area on the movieclip timeline.


something like this:

tell target "animationclip"
if currentframe==1
goto and play 10

if currentframe==10
goto and play 25

Anyone have any ideas?

Thanks.

GotoandPlay - Buttons Vs. Frame Actions
Does gotoandPlay() behave diff. if it is being used as a button action vs. being used as a simple frame action?

When I use it (as in the example below) directly from a frame as a frame action it seems to behave the same as gotoandStop()

example:
I have a movie clip with 10 frames and 2 layers.
Layer 1 has a stop() action in frames 1 and 10.
Layer 2 is a shape tween.

When I say movieclip.gotoandPlay(2) from a frame action it doesn't play... it goes there and stops. But if I call it from a button
on(release){
movieclip.gotoandPlay(2);
}
It works just fine.

The main time line is one frame. and the only scripts in the movie are the goto action(s) and the 2 stop scripts in the movieclip.

Any ideas? I don't know what else to try. Am I missing something simple?

any suggestions would be greatly appreciated.

thanks
--Mizary
(My 1st post!!)

Controlling MovieClip Via Actions In Frame
Hi all,
It's been a long, long while since I posted here. I would like your help on controlling a movieclip through action script.

My problem is:
My movieclip is a car, it is called "mycar". The only thing that is animated are the car wheels which spins 360 degrees, as if it is on the move. I would put the movie clip outside the Movie stage on the right, then I would make it move to the left. It would give the effect of a car driving to the centre.

In the centre, the car would stop. The prob is the car wheels won't stop spinning. I thought my solution would be putting a script in a frame, at the point where the car stops. It was in frame 40 of the main movie timeline. There are no scripts in "mycar" movieclip.

This was the first script I put in frame 40, to stop the movieclip playing.

mycar.stop()

It didn't work, so I tried the following steps. In "mycar" movie clip, I placed static wheels in frame 11. Then I put the following script in frame 40.

mycar.goandstop(11)

It didn't work, either. The car wheels keeps spinning no matter what.
Am I able to control movieclips through actions in a frame, when the playhead enters? It is a bit like Director, e.g.:
on exitframe
do this
do that
end exitframe

Can you, please, help me out? Apologises for the long post!

Need Some Frame Actions Substitute For OnClipEvent
Hi pplz..

I have some problems with ... it's rather stupid but i cant figure it out..
im loading a XML driven menu that holds a writer and some of its publications..

(its like Category - Products kind of menu)

Well i borrowed a scollbar source from a flashkit submition
that's based on The movieclip action (onClipEvent)

All is well but i need to run the actions from the timeline
instead of from the clip....

is there anyone who has a good way to run this script from the timeline

onClipEvent (load) {
this.loadVariables(SelectedStory);
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
numLines = 3;
origHeight = scrollbar._height;
origX = scrollbar._x;
needInit = false;
function initScrollbar() {
var totalLines = numLines+TextBox.maxscroll-1;
scrollbar._yscale = 100*(numLines)/totalLines;
deltaHeight = origHeight-scrollbar._height;
lineHeight = deltaHeight/(TextBox.maxScroll-1);
}
function updateScrollBarPos() {
scrollbar._y = lineHeight*(TextBox.scroll-1);
}
}
onClipEvent (enterFrame) {
if (needInit) {
if (TextBox.maxscroll>1) {
initScrollbar();
needInit = false;
}
}
if (frameCounter%speedFactor == 0) {
if (scrolling == "up" && TextBox.scroll>1) {
TextBox.scroll--;
updateScrollBarPos();
} else if (scrolling == "down" && TextBox.scroll<TextBox.maxscroll) {
TextBox.scroll++;
updateScrollBarPos();
}
frameCounter = 0;
}
frameCounter++;
}
onClipEvent (mouseDown) {
if (up.hitTest(_root._xmouse, _root._ymouse)) {
scrolling = "up";
frameCounter = speedFactor;
up.gotoAndStop(2);
}
if (down.hitTest(_root._xmouse, _root._ymouse)) {
scrolling = "down";
frameCounter = speedFactor;
down.gotoAndStop(2);
}
if (scrollbar.hitTest(_root._xmouse, _root._ymouse)) {
scrollbar.startDrag(0, origX, deltaHeight, origX);
scrolling = "scrollbar";
}
updateAfterEvent();
}
onClipEvent (mouseUp) {
scrolling = 0;
up.gotoAndStop(1);
down.gotoAndStop(1);
stopDrag();
updateAfterEvent();
}
onClipEvent (mouseMove) {
if (scrolling == "scrollbar") {
TextBox.scroll = Math.round((scrollbar._y)/lineHeight+1);
}
updateAfterEvent();
}
onClipEvent (data) {
needInit = true;
}
........................................
Thanx

Actions That Change Html Frame
I need to learn how to make a hybrid site. I want my buttons (top frame) to be flash and my bottom frame to be html (maybe some flash too)

I hate to use 2 advanced as an example... but I really want to accomplish the layout of http://www.xs-engineering.com/

Tutorials are good, but is there just a simple action script that I am forgetting about to change the bottom frame?

Let me know,

Buttons Vs Frame Actions - Which Has Precedence
I placed timing actions in each frame to cause the movie to pause five seconds and then play the next frame.

Then I decided to install a pause, fast forward, next frame and return button.

But the buttons seem to upset the normal flow of the frame actions and the frames are played out of sequence and jump all over the place.

I first tried on release, gotoAndStop. Then thought the Stop was the problem, so I tried gotoAndPlay for my buttons. For the fast forward I used gotoAndPlay (_currentframe + 3)

Are there rules of precedence going on here? Anyone. For anyone answering, just a simple,
yes, I have done it, your code must be wrong would be sufficient or

no, there are always conflicts when button actions interupting frame actions of this type are put together.

Many thanks for anyone who answers.

Button Actions In One Frame Not Working
Hi,

I found out the other day how to apply actions to buttons from one frame, which is great. But I've just tested the file now and its not working right, i'm confused to hell because I really can't see anything wrong with the scripting or otherwise.

I've created a slideshow which chooses random images from the selection, the user can then click each image to take them to a specific site, this info is loaded from the text file onto the button. You will see that clicking on the images doesn't open the website everytime, but sometimes it does, the error is completely random, which is why its so hard to figure out.

It'd be great if a couple of you Flash gurus out there could take a look at this and see if you can figure it out better than I can, it's driving me nutts!!

How Do I Assign Actions For Buttons From A Frame?
Can someone tell me how I can assign actions to a button from a frame?

i.e. I'll have a button on stage.
And in frame 1 ove the movie, I will assign the actions that happen when the button is clicked.

I've seen it done in plenty of places... but I can't remember how!

Thanks.


OM

Actions Work For Button, But Not Frame, Why?
the code below works when attached to a button using on(release), but i need the code to run independent of any user interaction.

i put the code in a frame, but it doesn't work.. any ideas?

result="waiting";
fscommand("get_cookie", "bg,result");
text=result;
tellTarget ("ValueChecker") {
gotoAndPlay(2);
}

i've also tried _root.ValueChecker.gotoAndPlay(2); instead of using tell target, both methods work when triggered by a button, but not via frame actions

thnx

Actions/Frame Text Hyperlink Help
It seems so simple and yet it is so hard! All I want to do is create a text hyperlink in the Text Variables area of my actions frame...I have modified all of my content in there and everything looks great with the excetion of this issue!

If someone could give me an example of the correct script from the beginning to end I would be SO VERY GRATEFUL...I am loosing my patience and have spent way too much time with syntax errors to last a LIFETIME!


Right Now I am only displaying this text in the text variable frame...

text ="<b>Ultimate Trade Shows:</b> www.tsnn.com"+newline+newline+"<b>Seminar Information:</b> www.seminarinformation.com"+newline+newline+"<b>Juvenile Product Manufacturers Association:</b> www.jpma.org"+newline+newline+"<b>GiftWare News:</b> www.giftwarenes.com"

Strange Frame Actions Problem
I am experiencing the strangest frame action's problem!!! All of them work completely fine until I place a .jpg on any frame of the movie! That's when everything stops working! What is going on??

Button With Multiple Frame Actions
I've got a button that is acting essentially as the stage of the mc. I want to have the the button "the stage" when clicked to go to the desired frame. I wan't something to the figure of 30 actions on this button, each time going to a new frame. Is there an easy way to write an action script 2.0 for this opposed to keyframing the button over and over and changing the variable on the action going down the timeline...

[F8] Function + Variables All In Actions Frame
The following code is what I have in an actions frame:


Code:
function FLOAT_engine() {
this._x = this.cenX+Math.sin(this.angleX)*this.rangeX;
this._y = this.cenY+Math.sin(this.angleY)*this.rangeY;
this.angleX += this.xspeed;
this.angleY += this.yspeed;
}
floaty.onEnterFrame = FLOAT_engine;
floaty2.onEnterFrame = FLOAT_engine;
etc.
And in my movieclip (floaty) I have the variables:


Code:
onClipEvent (load) {
cenX = this._x;
cenY = this._y;
angleX = 0;
angleY = 0;
rangeX = 5;
rangeY = 5;
xspeed = .05;
yspeed = .06;
}
How would I got about re-writing this code so it is all in the actions frame? The way that I have it set up now, I'd have to paste the variables into every movieclip. It would be a pain if I ever wanted to change the values. Thanks in advance.

Frame Actions In Embeded MC Not Working
I have a movieclip embedded in another clip which is embedded in another clip which is on the stage. Tracing does not show up when I trace from a frame. Code only ever seems to run if it's broken- as in, code doesn't seem to do anything, but if there is an error, the compiler will complain!

The clip is playing and omit trace actions is UNchecked.

is there something new about AS3 I'm missing here?

Frame Actions And ENTER_FRAME Problem
Hello,

I have a flash that will show pictures when user click and drag in the main area:

+++++++++++++++++++++++
+ +
+ THIS_IS_PICTURE +
+ +
+ +
+++++++++++++++++++++++

Something like above. When user click and drag the picture, the picture will change to another one, and so on, there are 10 pictures.

To implement this, I created a .fla file with 10 key frames, one each frame I added a MovieClip symbol, and in the document class, I have 10 loaders to load each picture individually, and add those loaders to the MC's.

Here's the problem, what I'm doing now, is to add Actions to each frame, by right clicking on the frame dot and select Actions, then add code that would add the loaders to MC's. But this is inefficient.

Then I tried to use Event.ENTER_FRAME in the constructor of the document class. However, this did not work: in the event handler, the MC's on different frames cannot be accessed.

Here's the code.


Code:
addEventListener(Event.ENTER_FRAME, test);

function test(e:Event): void
{
if (!(e.target is MyClass)) {
return;
}

for (var i = 0; i < numChildren; ++i) {
trace(e.target.getChildAt(i)); // same thing if just use getChildAt(i);
}
}


The result is always "null", instead of MovieClip. The strange thing is, "numChildren" is 1. Please help, thanks a lot in advance!

Is It Possible To Put The Actions I Have In Frames 1 And 2 Into A Single Frame?
Hello, I'm new to actionscript 3.0.
I've attached the file I need help with.
My question is: Is it possible to put the actions I have in frames 1 and 2 into a single frame ? And if so how is this possible?
Basically, I want to all my code to be on a single frame, and still be able to function properly.
Sorry if this topic has been posted before, but I couldn't find anything for my specific need.

Thank you.

Actions Frame Redraws Very Slowly
When I move a window in flash 9.0 it takes ages to redraw. Even when I use the keyboard to scroll throgh code-lines it redraws so slowly that it is actually useless.

Any hints how to getting around this problem? (I'm thinking about reinstalling the old version).





























Edited: 12/02/2007 at 08:42:53 AM by andersduus

Need Some Help With Flash Actions/frame Behaviors
The dimension of my flash file is around 850 by 800, so it is a little too big for most screen sizes. The problem I am having however is that I want each frame to start back at the top. When I click on the next button or previous button, it shows the frame in the same orientation as the previous one. Any help please?

Frame Actions, Basic Navigation
Hi
I've recently started using CS4 and am having a problems trying to put actions into a frame. i used MX years ago so i thought i has a slight understanding of creating a simple website but am having a few lil problems.
I have a scene which has an intro animation, and an outro animation. What id like to be able to do is to have buttons that when pressed will play the outro animation then automatically goto a scene.

is it possible to make a button play the outro animation then goto scene 2, and have another button on the same stage that will play the outro animation then goto scene 3?

im sure this is real noob teritory but maybe im not seeing the wood for the trees?
many thanks in advance

Put The Button Script In The Actions Frame
When I click each button I want it to advance the play head to the Frame Lable.
This code works but I need to change the state of the button.
If I change the button State to Graphic in the Key Frame Lable it makes the code not work.
I would like to have all the code the the main timeline Actions Layer.

ie: When Button1 is pressed it goes to "F1" and is now in the Down State.
When Button 2 is press it goes to "F2" and is in the Down State and Button 1 goes back to its' Up State.

Here's the code:
stop();
Button1.onRelease = function() {
gotoAndStop("F1");
trace ("Frame 1");
};
Button2.onRelease = function() {
gotoAndStop("F2");
trace ("Frame 2");
};
Button3.onRelease = function() {
gotoAndStop("F3");
trace ("Frame 3");
};

Actions To Play Mc-move To Next Frame?
This may be a rather silly question but can somebody help me with this. I have a movie clip in frame 1, then my site starts in frame 2. What actions do I need to place in frame 1 to tell it to play the movie clip then once the movie clip has finished move onto frame 2? I just have the mc sitting in frame 1 and it plays then stops but doesn't move onto frame 2. Thanks in advance for any help.

I Imported A Class, But Cant Use It On Frame Actions?
Hey guys,

I imported a package into my DocumentClass, and it works fine when I reference it from the DocumentClass...however, when I try to use the stuff from it in flash I get errors.

Can someone point me in the right direction to learn how to use functions from an imported package, but use them as an action on the timeline somewhere within flash?

Thanks a ton!

~Scott

Copyright © 2005-08 www.BigResource.com, All rights reserved