[Flashcoders] Vars between game levels

2006-06-19 Thread Helios Pregioni Bayma

Hi,

I am developing a Flash Game of 4 levels (click to see
level4http://www.heliospb.net/jogos/Game_Peste_Attack_Fase4.html -
180kb with no preloader). As each level will be in separate swf files, I
have created a base swf that loads the levels in a holde mc, ok. The
problems started when I lost performance when doing that, what forced me to
find a new solution.

I tried so, to use Shared Objects to keep the vars (points, level, energy),
but it can´t be read by different swf.
So, I tried using an empty swf, and use LocalConnection to send vars to it.
It worked in sending the vars, but didn´t when I had to load those vars from
other swf, I just had succes sending them, not loading.

Any idea of how to solve this? Can be about what I tried or any new idea. I
am worried cause I need to finish the game as far as friday, and couldnt
solve this.

Thanks!

--
Helios Pregioni Bayma
Macromedia Certified FlashMX Designer
[EMAIL PROTECTED]  |  www.heliospb.net
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Vars between game levels

2006-06-19 Thread Andy Makely

On 6/19/06, Helios Pregioni Bayma [EMAIL PROTECTED] wrote:


I tried so, to use Shared Objects to keep the vars (points, level,
energy),
but it can´t be read by different swf.
So, I tried using an empty swf, and use LocalConnection to send vars to
it.
It worked in sending the vars, but didn´t when I had to load those vars
from
other swf, I just had succes sending them, not loading.




For a quick fix, you might try storing your values as _global variables,
since those values do not get reset when loading additional swfs.  For
example, if you store the var _global.currentScore, and then do a loadMovie
on the current SWF, you can have the incoming SWF check _global.currentScore
and the var should still be there.

--
andy makely
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Vars between game levels

2006-06-19 Thread Adam Pasztory

I don't see why using a holder clip would cause you to lose a significant
amount of performance.  Could it be there was some code in your holder clip
that was causing the problem?

On 6/19/06, Andy Makely [EMAIL PROTECTED] wrote:


On 6/19/06, Helios Pregioni Bayma [EMAIL PROTECTED] wrote:

 I tried so, to use Shared Objects to keep the vars (points, level,
 energy),
 but it can´t be read by different swf.
 So, I tried using an empty swf, and use LocalConnection to send vars to
 it.
 It worked in sending the vars, but didn´t when I had to load those vars
 from
 other swf, I just had succes sending them, not loading.



For a quick fix, you might try storing your values as _global variables,
since those values do not get reset when loading additional swfs.  For
example, if you store the var _global.currentScore, and then do a
loadMovie
on the current SWF, you can have the incoming SWF check
_global.currentScore
and the var should still be there.

--
andy makely
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Vars between game levels

2006-06-19 Thread Helios Pregioni Bayma

Thanks for the idea Andy, I´ll try that.

Adam, I know it´s strange. What I do in the base file is to define the 4
vars I need, create the sound objects - one for each level plus one for the
base screen, and the screens to be showed before entering and while exiting
each level.

It works online and the performance problem doesnt happen all the time, but
only when I move the player. But this doesn´t happen when I am running it
directly on it´s html.
A strange fact is that it takes too much time to export the swf, what doesn
happen even in the levels files.

It´s a pitty, cause I don´t have time to keep looking for what´s wrong and
using a base swf is perfect for this game.

Thanks,
Helios

--
Helios Pregioni Bayma
Macromedia Certified FlashMX Designer
[EMAIL PROTECTED]  |  www.heliospb.net
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com