Be a Supporter!

[AS3] export movieclip to .swf

  • 921 Views
  • 3 Replies
New Topic Respond to this Topic
Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 07
Game Developer
[AS3] export movieclip to .swf 2012-10-16 03:20:07 Reply

I want to export MovieClip to .swf. Here's what I have to far.

var ref:FileReference = new FileReference();
var buff:ByteArray = new ByteArray();
buff.writeObject(leClip);//MovieClip's name
ref.save(buff);
stop();

right now, the exported swf is not working. Anyone knows what should I do?

ProfessorFlash
ProfessorFlash
  • Member since: Oct. 6, 2007
  • Offline.
Forum Stats
Member
Level 32
Programmer
Response to [AS3] export movieclip to .swf 2012-10-16 04:16:11 Reply

Object in bytearray form does not equal to an swf file. Giving the saved file the extension ".swf" does not actually make it a legit swf file, as you may have noticed. There is nothing you can do about that.


You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

Knight52
Knight52
  • Member since: Jan. 8, 2012
  • Offline.
Forum Stats
Member
Level 07
Game Developer
Response to [AS3] export movieclip to .swf 2012-10-16 04:23:57 Reply

At 10/16/12 04:16 AM, ProfessorFlash wrote: Object in bytearray form does not equal to an swf file. Giving the saved file the extension ".swf" does not actually make it a legit swf file, as you may have noticed. There is nothing you can do about that.

So... I can't?

milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to [AS3] export movieclip to .swf 2012-10-16 06:25:30 Reply

As3 cannot serialize DisaplyObjects.