AS code fragmentation?
"Laurent Cocea" <[email protected]> Thu, 04 Dec 2003 20:41:42 -0800 (PST)
| Newsgroups | gmane.comp.web.ming.general |
|---|---|
| Message-ID | <20031204204143.2792.h007.c009.wm@mail.canada.com.criticalpath.net> |
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