[FMX 2004] Newbie Problem: incomprehensible AS output error

…perhaps not for the experienced, but for me.

What I am trying to do is when my intro movie has finished playing, I want the main timeline to stop for one second, displaying the end of my movie, before it continues. This way I won’t have to make 24 frames with the image in it, which helps keeping my .swf small. :wink:

This is the AS code in the frame where I want the timeline to stop:


function Delay() {
var sTime = _root.sTime;
var curTime = getTimer()/1000;
if (curTime-sTime>2) {
gotoAndPlay (50);
this.onEnterFrame (50) = function {
_root.sTime = getTimer()/1000;
_root.delayInterval = setInterval(Delay, 100);

And this is the code output I get:

**Left side of assignment operator must be variable or property.
this.onEnterFrame (50) = function {

Perhaps someone can explain what the message means so that I can correct it.

basically, you can’t have the (50) statement like that. I’m not enough of an AS expert to know wht to change off the top of my head.

But I should say that having yoru image on 24 frames will not increase the size of your flash file at all. Flash uses “instances” of things, so it’s only loading the image 1 time (on the first frame it appears on). You can verify that by turning on the option in your publish settings to generate a rteport. Look at that file after publishing and you will see the actual filesizes per frame. YOu should see a big number on the first frame the picture is on, and then tiny ones after that.

just drop it all together, add () after function (nothing gets added in between, and for functions that are defined with parameters, they are then, at that point, variable names.

this.onEnterFrame = function(){


I am going to try it right away!