View unanswered posts | View active topics

Reply to topic  [ 6 posts ] 
Problem using MovieClip created by swfmill 
Author Message

Joined: Mon Apr 06, 2009 4:56 pm
Posts: 6
Hi all,

I'm new to Flash and ActionScript and up to now I've been using the trial version of Adobe Flash CS4 for learning. But the trial version expired, so I searched for some free alternatives and found Flashdevelop.

As for my problem: I am trying to import an animation as MovieClip into Flashdevelop.
I created the MovieClip (actually a swf file containing this MovieClip in its library) using swfmill from an xml file looking like this:

<?xml version="1.0" encoding="UTF-8"?>
<movie version="8" width="300" height="300" framerate="30">
  <background color="#ffffff"/>
    <clip id="0001.png" import="0001.png"/>
    <clip id="0002.png" import="0002.png"/>

     <clip id="Test">
      <frame name="f1">
         <place id="0001.png" depth="16284" x="0" y="0"/>
      <frame name="f2">
         <place id="0002.png" depth="16284" x="0" y="0"/>

      <clip id="Test2" import="0010.png" />
   <place id="Test2" name="test" depth="16385" x="100" y="100"/>


In Flashdevelop I use an AS3 Project with code like this:
   [Embed(source = '/../lib/Test3.swf', symbol = 'Test')]
   var Test2:Class;
   addChild(new Test2());

This works for symbol = 'Test2' - the clip without frames that just loads one picture but not for symbol = 'Test" - the clip with several frames. Here I get the error message:
Quote: col: 16 Error: Syntaxfehler: identifier vor colon erforderlich.
public var :flash.display.DisplayObject;
Build halted with errors (fcsh).

Can anyone tell me how to fix this?
Also, if there is a better way to do something like this, let me know.

Mon Apr 06, 2009 5:29 pm

Joined: Sun May 11, 2008 3:01 pm
Posts: 895
It would be really cool if SWFmill could create AS3 MovieClips... regretfully, it's for AS2 only... Even though the AS2 and AS3 assets aren't to different, you cannot use AS2 instead of AS3, you actually have to use AS3 clips with [Embed] meta tag. If you want to do that with AS3, you may try to use SVG files for vector graphics... It's not perfect, and SVG format isn't fully supported, but, for simple shapes it would do... Another suggestion - use Degrafa library. It is for MXML / Flex, but it gives you quite a lot of options for creating graphics with script.

For the last error message - it says you've forgotten to give the name to the variable. It should be something like:
import flash.display.DisplayObject;
public var someVar:DisplayObject;


Wed Apr 08, 2009 12:42 am

Joined: Mon Apr 06, 2009 4:56 pm
Posts: 6
Thank you for your answer.

As I said I'm pretty new to Flash and ActionScript and up to now I've been using Adobe Flash with ActionScript2. With Flashdevelop I thought I'd go with ActionScript3. So I'm still a bit confused about the differences between the two.

So, SWFmill creates AS2 MovieClips...But in AS2-Projects I can't use the [Embed] statement to access the MovieClips. Did I get this right?

As for SVG... In this case I don't use vector I guess SVG won't help. But I will have a look at Degrafa.

About the error message: I figured out what it is trying to tell me. The actual problem was that the code producing that error is not in my code. I guess it is something the compiler creates internally for the embedded MovieClip and the error originates from the MovieClip being AS2.

Wed Apr 08, 2009 11:51 am

Joined: Sun May 11, 2008 3:01 pm
Posts: 895
If you don't need vector graphics, just embed the PNGs (with the same [Embed] tag). And, yes, you've understood it right, [Embed] is for AS3 only, more precisely, only for MXMLC compiler, Flash compiler doesn't understand it. And, if you're very new to AS3 and MXML, then, Degrafa may be somewhat complicated... I'd first try simply using [Embed] with images.


Wed Apr 08, 2009 2:32 pm

Joined: Mon Apr 06, 2009 4:56 pm
Posts: 6
Had a chance to look at Degrafa. Looks interesting but I guess I should learn some more ActionScript first before I continue with Flex, MXML and possibly Degrafa.

Wed Apr 08, 2009 8:23 pm

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Paltar, the error reported by the compiler just says your variable declaration is incorrect.

Thu Apr 16, 2009 9:00 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.