converting old script to Flash 8 help
January 6th, 2009
I found this neat fla in an old folder of Flash files. I'd like to use it in an upcoming project, but the problem being that it won't work in Flash 7 or 8. I don't know enough AS to convert it over, so I was hoping one of you smarty pants could help me out.
Thanks,
GD
http://www.geraddavis.com/random/dynatint.zip
No he didn't, he must've made a mistake in testing.
The main thing to point out is that AS2 is case-sensitive, so movieclip (:td:) isn't the same as MovieClip (:thumb:):
MovieClip.prototype.fademe = function() {
for (var i in this.myVals) {
this.myVals[i] += (this._parent.targvals[i] - this.myVals[i]) / this.speed;
}
this.col.setTransform(this.myVals);
};
You should also know that what you have there isn't exactly 'good practice' - for lack of a better term.
Hope this helps :hoser:
I read every Flash 8 book avalaible when it came out, and i learn something new everyday. Practise makes perfect.
Another thing. I like to keep all my code in the timeline, but it takes a little rewriting to move the actions from a movie clip to the timeline. Take this file for example. The movieclip has this code on it: onClipEvent (load){blah blah blah}
Would this be translated to this if I wanted to move it to the timeline?
onLoad(){ blah blah blah}
I wish there was a side to side coders quick guide to this sort of thing.
Hope this helps :hoser:
'Good practice' - as in bad coding or forum etiquette? :puzzled:
This file was something a friend found and shared with me years ago. I'm guessing it was made in Flash 5! And I don't think I've been inappropriate.
Anyway, thanks for pointing that caps problem out to me. I'll switch that stuff around to see if it works.
GD
you got the photo to change colors in flash 8? hmmm... it wouldn't work for me.
Flash comes with a help file that explains that sort of thing.. In fact, if you read through the best practices section, there is something close to a "side to side coders quickguide".
Scripting in the timeline though, the MovieClip.onLoad() method is nowhere near the same as onClipEvent(load) (well, close, but only used for mc's associated with class files). That clip event was mainly to initialize variables which you can do in the timeline.
so instead of:
onClipEvent (load) {
someVar = 2;
}
you can simply say:
var someVar:Number = 2;
You'll just have to watch the scope.
#If you have any other info about this subject , Please add it free.# |