Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 26th, 2004, 12:13 AM
MichaelCole MichaelCole is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 MichaelCole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question First frame of actionscript doesn't run...

Hi, thanks for looking. I'm trying this in Flash 6.0 and don't want to upgrade.

Here's my goal: I'm trying to animate some eyes to recorded dialog. So, being a newbie, I figure why not create a movie with functions for each direction the eyes can look. up(), down(), etc.

Then in a layer with blank keyframes, I can tell the eyes where to point, even if they are moving in a tween.

_root.eyes.front();
_root.moreEyes.left();

HOWEVER, the problem is this: In the *first* frame the eyes exist, I call the functions, but the direction of the eyes doesn't change. If I repeat the call in the *next* frame, the eyes update where they are looking. The only problem is there is one frame where the eyes are wrong.

The debugger will stop if I breakpoint the function call. The problem is that the display isn't updating.

I tried putting an updateAfterEvent(); call below my actionscript, but that doesn't help.

Any suggestions?

You can find my .fla here: URL

Thanks,

Mike

Reply With Quote
  #2  
Old February 26th, 2004, 02:50 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,715 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11109 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 50 m 46 sec
Reputation Power: 580
Facebook MySpace
Hi, I'm not sure which part of the animation your having a problem with. The only thing I noticed was that on the main stage the last frame with eye calling functions in only calls the second (stationary) set of eyes. I added:

_root.eyes.front();

to it as well. The eyes seem to move in the five defined directions.

upDateAfterEvent() only works if called in a function that is called with setIterval or when it in inside an onClipEvent handler. It wont do anything here.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old February 26th, 2004, 03:29 PM
MichaelCole MichaelCole is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 MichaelCole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Tann San
Hi, I'm not sure which part of the animation your having a problem with. The only thing I noticed was that on the main stage the last frame with eye calling functions in only calls the second (stationary) set of eyes. I added:

_root.eyes.front();

to it as well. The eyes seem to move in the five defined directions.

upDateAfterEvent() only works if called in a function that is called with setIterval or when it in inside an onClipEvent handler. It wont do anything here.

Hi Tann, thanks for the reply. I should be more specific.

The scene has two pairs of eyes. The eyes are movie clips and in *their* frame 1 they look forward. In their other frames, the pupils move around. I wrote some actionscript in the movie clip that changes the direction of the eyes...
<code>
function front() { gotoAndStop(1); }
function left() { gotoAndStop(4); }
function right() { gotoAndStop(5); }
function up() { gotoAndStop(2); }
function down() { gotoAndStop(3); }
</code>

In the *scenes* timeline, these eyes appear in frame two. When they appear, they start by looking forward. But, what I really want is for one to look up, and the other to look down.

So, calling my actionscript _root.eyes.left(); works in every frame the eyes are visible *except* the frame 2 (when they appear). When I debug, I see the script commands called in the debugger, but the pupils don't move.

If I put the actionscript in frame 3, the pupils move, but I can see them face forward in frame 2 and it has a jerky effect.

A workaround seems to be instead of calling: _root.eyes.left() calling _root.eyes.gotoAndStop(4); This makes the right animation, but it just looks ugly, and doesn't make sense! I have to explain to some non-flash animators how to use these eyes to make flash animations, and I'd like to keep it really simple.

So, the problem is my left() function doesn't *do* anything when it's called in the first frame of the movie, but if called in .

Does this make sense to anyone? Why isn't my function being called in the first frame the movie appears?

Cheers,

Mike

Reply With Quote
  #4  
Old February 27th, 2004, 03:18 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,715 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11109 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 50 m 46 sec
Reputation Power: 580
Facebook MySpace
Hi, I think it has something to do with the eyes loading time. To us it doesnt look like it takes any time to load them but too the system it does. A simple fix is to have the eyes start in frame 1. In the attachment this is exactly what I have done. There's now an extra frame for each eye at the start of the movie. In these two frames I have set the eye _alpha to 0 so it still appears that they begin after clicking the button. This allows all the code that is within the eye movie to be loaded prior to trying to use it (which is what I think the problem might be).
Attached Files
File Type: zip Eyes.zip (33.2 KB, 163 views)

Reply With Quote
  #5  
Old February 27th, 2004, 02:19 PM
MichaelCole MichaelCole is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 MichaelCole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dude! You rock!

Quote:
Originally Posted by Tann San
Hi, I think it has something to do with the eyes loading time. To us it doesnt look like it takes any time to load them but too the system it does. A simple fix is to have the eyes start in frame 1. In the attachment this is exactly what I have done. There's now an extra frame for each eye at the start of the movie. In these two frames I have set the eye _alpha to 0 so it still appears that they begin after clicking the button. This allows all the code that is within the eye movie to be loaded prior to trying to use it (which is what I think the problem might be).



Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > First frame of actionscript doesn't run...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT