0

I am trying to download a heavy swf dynamically to my site using URLLoader class. I'd like to know if it is possible to use a symbol inside the swf as a separate object?

The code used right now uses the embed statement as follows:

[Embed(source="/Fight.swf", symbol="Kungfu")] 
public class Kungfu extends MovieClip
{ ... }

Embedding the swf increases the initial load time of my site and I want to make it dynamic. How can I access the Kungfu symbol from Fight.swf after it is downloaded using the URLLoader class?

Shiva Nandan
  • 1,835
  • 1
  • 13
  • 11

2 Answers2

1

You need to get the class definition from the loaded SWF. Few months ago I summarized the process here. The example used bitmaps, but you can use movie clips as well.

taskinoor
  • 45,586
  • 12
  • 116
  • 142
0

... Why not use SwfLoader? It's Flex native. If you're not in Flex, why not use a Loader?

Either way, I don't think that URLLoader is what you really want here.

cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
  • Thanks :) I shouldn't be using URLLoader. I'm not on flex, but I use flex builder for development. So I'll go for using the Loader class. Can you please tell me how I can use a symbol from the loaded swf file and use it as an object in my project? – Shiva Nandan Jun 17 '11 at 06:01