PDA

View Full Version : One .as file used in flash 8 and flex 2?


willmeyer
09-16-2006, 03:29 AM
Hi gang. I am loading Flash 8 SWFs in my flex stuff and doing the LocalConnection stuff to communicate between them. All is ok there. BUT, I want to use the same library of code I created in both flash 8 and flex 2 projects. I am keeping flash 8 stuff around so I don't require people to have flash 9 installed except for a few specific apps (the flex ones) -- so that's why I am not just porting everything.

So is there a way to compile the same code in both AS3 and AS2? Without a preprocessor I can't ifdef certain incompatible things, and obviously not all the same code will work in both. Any suggestions? I would REALLY not like to have to maintain two separate versions of the library simultaneously if at all possible, but the code is very much API like. I have never made a "component" -- would that be something to look into? Any other ideas on how to make an API that will work in both versions of AS?

Thanks for any tips.

senocular
09-16-2006, 03:37 AM
They would have to be separate.

willmeyer
09-16-2006, 10:47 AM
They would have to be separate.

Thanks for the response. So there's no way to compile the code to some kind of library then either? That was my last hope...

senocular
09-16-2006, 01:28 PM
The whole reason for the need of LocalConnection is that they are running under 2 separate virtual machines that can only run their own version of code (AS1 & 2 or AS3).

willmeyer
09-24-2006, 01:19 AM
Got it. I miss the old C preprocessor ;-). Thanks for all the help.