Groups | Blog | Home
all groups > flash actionscript > april 2006 >

flash actionscript : 7000+ lines of code causes erratic behaviour



Motion Maker
4/23/2006 6:08:35 PM
My guesses aside from a logic problem are that it could be something you
stumbled on that the compiler is not getting (what are your publish movie
and AS settings?) or a corrupted movie.

Here are some items I might try. Make backups of course.

Try publishing with a different computer and copy of Flash.

Try Save and Compact.

Try Save As.

Try rebuilding from a brand new movie. Will require quite a bit of cut and
pastes.

Try loading code in smaller units from external swfs. Although I do not see
why it cannot be in one Flash movie unless there is a known limit I never
hit and I am sure I have had Flash movies with at least that much code.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
I've been having problem with a game I'm writing, I've got nearly 7000 lines
of
code now (over 5000 in 1 frame), and flash has started producing some
strange
behaviours. I've post on flashkit
http://www.flashkit.com/board/showthread.php?t=683922 and another user has
an
identical problem.
Sometimes, a published swf will do a range of odd behaviours - it will do
exactly the same thing for each published swf, but then making completely
minimal code changes (even changing the content of a text string which is
never
refered to) will then cause the swf to perform correctly.
Sometimes the swf just freezes, sometimes it gets caught in a loop
switching
between high quality and low quality, sometimes it tries to load a location
made up of garbled letters, or on one occassion opened up over a dozen new
browser windows.
This is always triggered whenever a swf is loaded into the main swf.
I could only think that they was too much code and some of it was being
ignored, I tried using external as files, but this didn't fix it, and other
users on Flashkit have twice the code I have and no problems.
Is this a known issue? is there a work around?
(I'm using Flash 8 professional)

derelttil
4/23/2006 9:48:13 PM
I've been having problem with a game I'm writing, I've got nearly 7000 lines of
code now (over 5000 in 1 frame), and flash has started producing some strange
behaviours. I've post on flashkit
http://www.flashkit.com/board/showthread.php?t=683922 and another user has an
identical problem.
Sometimes, a published swf will do a range of odd behaviours - it will do
exactly the same thing for each published swf, but then making completely
minimal code changes (even changing the content of a text string which is never
refered to) will then cause the swf to perform correctly.
Sometimes the swf just freezes, sometimes it gets caught in a loop switching
between high quality and low quality, sometimes it tries to load a location
made up of garbled letters, or on one occassion opened up over a dozen new
browser windows.
This is always triggered whenever a swf is loaded into the main swf.
I could only think that they was too much code and some of it was being
ignored, I tried using external as files, but this didn't fix it, and other
users on Flashkit have twice the code I have and no problems.
Is this a known issue? is there a work around?
(I'm using Flash 8 professional)
Jeckyl
4/24/2006 12:00:00 AM
There is a limit in compiled SWF code for how far you can jump (eg how much
you can have inside and if/loop etc) .. this is due to script using a 16-bit
offset ie +=32767 bytes. There are other similar limitations in script, and
Flash does not complain about it .. it just produces bad code. If your
script is very big, you could be running into those limitations.
--
Jeckyl

derelttil
4/24/2006 12:00:00 AM
thanks for your replies - I've tried starting from a blank fla and completely
re-importing everything - the problem still occurs.
I'll try compiling it on another machine.
Jeckyl - so I can have a maximum of 32767 bytes within a single if statement?
but, why would it then start working when I add more code to the statement?
kumzlee
4/24/2006 12:00:00 AM
derelttil
4/26/2006 7:44:21 PM
AddThis Social Bookmark Button