PDA

View Full Version : Calling methods in external SWF


jedimaster
08-01-2003, 07:30 AM
Say I include an external SWF - is it possible to call methods defined in that SWF? Ie, someSWF.foo() ?

antun
08-01-2003, 08:08 AM
No, that's absolutely not supported. The reason is twofold:

First, it's a step back towards having code in multiple places - some in a .fla file before it metamorphosed into the .swf, and some in .lzx files. Wouldn't you just love to be the engineer that's handed the task of maintaining that one, eh?

Second (and perhaps more importantly) if ever we decide to move to a different runtime environment (i.e. not the Flash Player), this would be unlikely to work.

-Antun

jedimaster
08-01-2003, 08:21 AM
Errr - but what about code in external files you include? It's not a huge big deal that you don't support calling methods in other swf's, but you answer seems to imply that the concept of putting code into a class you can include elsewhere is bad. I know you didn't _mean_ to say that of course, but that's how it came out. Now, that being said, having to deal with your code and AS _would_ be a pain, I'd rather just deal with one or the other.

It's more a question of - if we have old resources and code, we have to port. This isn't the end of the world - I am extremely impressed with what I see so far - but you may want to consider adding support - even if it's only one way, ie, allowing for swf.foo(), not x = swf.foo()

antun
08-01-2003, 09:18 AM
You're right - I didn't mean that it's bad to split your code up across files - that's actually good practice. Like you said, it's more about different environments altogether. Say you build a large project in Laszlo, and hand it off to a client. One of the ways you could sell that to your client is that it's extremely maintainable, so their IT department could take over.

However if you've used a lot of .swf widgets it suddenly stops being that maintainable.

We have actually thought about this long and hard. It's been suggested a number of times, by people who have done Flash work in the past, and as you mentioned, had a library of code.

I'll certainly internally raise the issue again for you.

Take care,

Antun

jedimaster
08-01-2003, 09:40 AM
Thanks! I'm very impressed by the level of support at this company.