The External API is ignored when used under Flash 7.  What you could do
is run an if statement which checks the process of some other flash 8
only statement.  If the statement was successful, the flash 8 code is
run, else the flash 7 code is run.  It would mean having more code in
total, but would at least allow you to have both formats supported.  I
used to use a similar method when Flash 5 was released to check for the
Flash player version.

Regards,
Lee

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Christian
Sent: 05 June 2006 14:30
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Conditional Import Statements

Unfortunately I am packaging up a set of classes for mass distribution 
for work, so that won't work.  That would be too easy :)



Scott Hyndman wrote:
> You could also use haXe, which offers conditional compilation. The
> language isn't so different than ActionScript either.
>
> Scott
>
> On 6/5/06, Christian <[EMAIL PROTECTED]> wrote:
>> Hrmmm... interesting.  I'll have to try that out, but seems like
>> potentially a lot of overhead no, with the subswf's, and then
managing
>> naming, loading and possible deletion?
>>
>> Thanks for the help though, this is at least a good start.
>>
>> Tyler Wright wrote:
>> > The only way is to compile the classes into a seperate SWF's and at
>> > runtime
>> > when you make the check load in the appropriate SWF. Not a very
simple
>> > solution.
>> >
>> > I've found that a good solution, if you can afford to combine the 
>> classes
>> > into one, is making a runtime check on functionality.
>> >
>> > jsConnection = (ExternalIntervace != null) ? callEI : callGetURL;
>> >
>> > function callEI()
>> > { ... }
>> >
>> > function callGetURL()
>> > { ... }
>> >
>> > make sense?
>> > Tyler
>> >
>> >
>> > On 6/5/06, Janis Radins <[EMAIL PROTECTED]> wrote:
>> >>
>> >> no there is no way
>> >> improts are executed at compile time all you can do is to define 
>> which
>> >> class
>> >> to use depending on player version
>> >>
>> >> 2006/6/5, Christian <[EMAIL PROTECTED]>:
>> >> >
>> >> > Hey Guys,
>> >> >
>> >> > So i'm in the process of writing a class that does a lot of 
>> JavaScript
>> >> > handling.  The tricky part is, I want to use External Interface
for
>> >> > those files published in 8 and simple getURL calls for those 
>> published
>> >> > in 7 or below.
>> >> >
>> >> > For all intents and purposes, this is a private class that won't
be
>> >> > exposed to the public, so I can't simply require the user to
import
>> >> > version 8 of class or version 7 of class.
>> >> >
>> >> > Is there a way to do a conditional import based on published 
>> version,
>> >> > instead of runtime version?  I often use $version to detect
major
>> >> > version of play to handle other functionality, but as you all
know
>> >> > External Interface breaks if not published in 8.
>> >> >
>> >> > OR better yet, could I simply just copy the file to the FP7 
>> folder and
>> >> > fake it?
>> >> >
>> >> > Does this make sense or am I smoking crack here?
>> >> >
>> >> > Christian
>> >> > _______________________________________________
>> >> > 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
>> >>
>> > _______________________________________________
>> > 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
>>
> _______________________________________________
> 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
_______________________________________________
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