logo       

AS code fragmentation?: msg#00018

web.ming.general

Subject: AS code fragmentation?

H all-

I have read through a number of AS optimization strategies on the web;
most authors encourage developers to place as much code as possible in
the main timeline and every major piece of actionscript (e.g.,
everything related to a particular movieclip) in a single frame.

In my case, my movie contains many interacting objects and the size of
the associated AS is considerable so that I need to split it over
multiple frames else the Flash MX player crashes. I wonder how far can I
go using this approach; for example, is it possible to split a function,
like this:

str1 = "function Document (title,subject) {";
str2 = " this._title = title;";
str3 = " this._ subject = subject;
}";

and then place each string in a separate frame:

$movie->add(new SFWAction(str1));
$movie->nextFrame();
$movie->add(new SFWAction(str2));
$movie->nextFrame();
$movie->add(new SFWAction(str3));
$movie->nextFrame();

Is this allowed and should it work? Thanks.

-Laurent


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise