We use a simple trick to perform this :

Prepare all your assets to be compiled to Flash 6, you will apply filters only
by code, then, in your code you need to create a local var called flash when
flash version is not 8, like that (sorry for the ugly code, it's just for the
demonstration):

if(parseInt(System.capabilities.version.split(" ")[1].substr(0,1)) < 8)
{
   var flash = {};
}

then you can know create filters like that without having any compiler error :

var myFilter:Object = new flash.filters.BlurFilter();

You need to use the complete classpath when creating the object, in this way you
don't have to add an import in your code (the compiler won't check that, and you
have defined a local var called flash so it don't warn you for calling a non
defined property)

Then you can compile in flash 6 version without errors. But for the moment if
you run your swf in flash player 8 you can't see the filters, you just have to
modify the version directly in the bytecode of the swf, the the swf can run in
flash player 6 (because the complete bytecode is targetted to version 6 except
the version byte) and your filters is visible in player 8.

I'll post you an example at that url : http://book.abe.free.fr/other/filters.swf

Hope that could help you.

Cheers,

Cédric




_______________________________________________
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

Reply via email to