?
Solved

Playing from one frame to another only

Posted on 2003-03-21
4
Medium Priority
?
161 Views
Last Modified: 2010-04-03
I have a movie clip which has a colour change over 100 frames. Depending on a percentage which is read in from a file, I want to animate the movie clip's colour changing by playing from one frame to another.

i.e. the old percentage is 20, the new one 80

=> play movie clip from frame 20 till frame 80

This has to all be done via actionscript, how do I do it?

0
Comment
Question by:GraemeScotland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 6

Accepted Solution

by:
henryww earned 2000 total points
ID: 8181357
that's not too hard.

when u say read in from a file, what sort? xml or txt?
anyway i think u would no problem with reading the data ...

ok ... now ... , make a movieclip with all the different colors u have from frame 1 to 100; say ... name it "color" or whatever u like

have a variable currPercent=80; etc ...
then use a function to monitor changes

//example - root main timeline

//frame 1
var lastPercent;
var currPercent;

// checks the percent continuously
// the rate of moving is the same as the frame rate
_root.onEnterFrame = function () {
    // check for difference
   if (currPercent != lastPercent) {
     if (currPercent > lastPercent) {
     // a bigger percent
     _root.color.nextFrame();
     lastPercent++;
     } else {
     // a smaller percent
     _root.color.prevFrame();
     lastPercent--;
     }
   }
}

//frame X
//read ur file
if the percent is bigger than it will move the color movieclip from current position left to right (nextFrame())
if the percent is smaller than it will move from current position right to left (prevFrame()) until match.

see if this helps.

cheers
0
 
LVL 6

Expert Comment

by:henryww
ID: 8213644
the code is no good??
0
 

Author Comment

by:GraemeScotland
ID: 8216306
Sorry mate, it didn't work, I ended up not being able to do it. There wasn't enough time in the timeline to do it effectively. I think it would have probably worked however, and since you're the only person who tried to help, the points are yours :-)
0
 
LVL 6

Expert Comment

by:henryww
ID: 8216746
oh really? why?? ....

well, if u need an working example, i can try and put it together quickly ...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question