This content has been marked as final. Show 4 replies
Check the help files.
Yeah like Roth said, check the help file for the right syntax, which in this case is myClip._totalframes instead of myClip.totalFrames.
Flash is pretty helpful if you give a hand first, by type casting the "myClip" and telling flash what kind of element it is either through
var myClip:MovieClip = this.createEmpty........
or by suffixing the instance name with _mc
flash will recognise it as a type of movieclip and will display all the associated properties and methods of it as soon as you press dot "."
Nearly every built in type is recognised through the suffix method, everything from _btn to _xml, theres a list somewhere in the help file
Thanks for the 'helpful' comment dr_ross. It sure is nice when someone actually gives constructive comments. I'd used 'totalFrames' in a previous project that must have been AS 1.0. When I searched the livedocs I found the following (which uses 'totalFrames' without the preceding underscore - just for your reference Rothrock - and I guess I assumed incorrectly that it was still the same:
Language Version : ActionScript 3.0
Player Version : Flash Player 9
The total number of frames in the MovieClip instance.
If the movie clip contains multiple frames, the totalFrames property returns the total number of frames in all scenes in the movie clip.
public function get totalFrames():int
The following code illustrates the use of the totalFrames property of a MovieClip object named mc1:
And then also another Adobe Support doc I read prior to posting:
Description Returns the total number of frames in the movie.
xample var totalFrames = movie.TotalFrames();
Thanks again dr_ross.
I think all of the properties in AS3 don't have the leading underscore. Whereas in AS2 and 1 almost all of them did.
Also capitalization is important and will get you every time.
Why would you search and use the livedocs when you have the help files on your computer? Also you said you have Flash 8 and are publishing for 8. So why would something introduced in Player 9 be what you are looking for?
If you want a constructive comment, "Learn to use the help files properly."