View unanswered posts | View active topics



Reply to topic  [ 8 posts ] 
Flash IDE movie clips do not show up when compiling in FD 
Author Message
Member

Joined: Thu Oct 18, 2012 11:33 am
Posts: 5
Reply with quote
I am using the latest version of Flash Professional CC and FlashDevelop ver. 4.5.2.5. In Flash CC I created simple graphics and turned it to a Movie Clip and linked to a class, which I created in FLashDevelop. The class is very simple:
Code:
package animals{
   import flash.display.MovieClip;
   import flash.display.DisplayObjectContainer;
   import flash.display.Sprite;
   import flash.geom.Point;
   
   public class animal extends MovieClip
   {
      public function animal(parent:DisplayObjectContainer, location:Point, rotation:Number)
      {
         this.x = location.x;
         this.y = location.y;
         this.rotation = rotation;
         parent.addChild(this);
      }
   }
}




In FlashDevelop I am trying to bring the movie clip on the stage by this line of code:
var playerAnimal:animal = new animal(camera, new Point(100, 100), 90);

‘camera’ in my case is placed on the stage using absolutely the same code, except for I don’t have any objects in .fla file linked to the ‘camera’ class.

The problem is that the movie clip does not appear on the stage/camera. After compiling I do not see it on the screen. FlashDevelop shows no error messages.

Please advise what can be wrong? Thanks in advance!


Last edited by Commanch on Fri May 23, 2014 11:17 am, edited 1 time in total.



Thu May 22, 2014 8:06 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
More details please - also what workflow are you using?
see: http://www.flashdevelop.org/wikidocs/in ... ?title=AS3


Thu May 22, 2014 1:27 pm
Profile WWW
Member

Joined: Thu Oct 18, 2012 11:33 am
Posts: 5
Reply with quote
Hello Philippe, thanks for answering.
I am using FlexAndFlashCS3Workflow.
Please let me know what other details I shall provide... The compiler works with no problems unless I try to use movie clips from SWC.

Image
In Flash EDI I linked my movie clip to the class created in FD on Linkage properties. I also added SWC to the projects library, you can see it in blue.

All other graphics, not from SWC, shows after compilation, but not movie clip from SWC. At the same time I am not getting any errors after compilation.


Fri May 23, 2014 11:07 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Ok I think I understand the problem :)

First, try naming exported symbols with an uppercase (ie. Animal).

Second, you should not associate a class directly with a symbol, it should either inherit or extend the symbol. This is explained in the doc:
http://www.flashdevelop.org/wikidocs/in ... S3Workflow


Fri May 23, 2014 9:42 pm
Profile WWW
Member

Joined: Thu Oct 18, 2012 11:33 am
Posts: 5
Reply with quote
Hello Philippe, Thanks for the tips, I got it working. Now the movie clip appears on the screen. I used examples from the link you gave.

But I really don’t understand why I can’t associate my symbol with my class directly. I have a couple of tutorials where the gurus say that I can do so and give examples of how it works. Well, the tutorials are of 2010. I guess things have changed since then…


Mon Jun 02, 2014 7:14 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
When using a SWC you can't and there's a reason for that:
- imagine a SWC like a classpath,
- it contains "magic" classes which have graphics linked to them,
- BUT if the original classes you linked in the SWC are ALSO present in the classpath, they will replace the classes from the SWC, and so you lose the linked graphic.


Mon Jun 02, 2014 9:54 am
Profile WWW
Member

Joined: Thu Oct 18, 2012 11:33 am
Posts: 5
Reply with quote
I will have to re-open this topic. As you suggested my class extends the symbol. For example:
public class Cow extends MyCow
- where MyCow is also a class in my base SWC.
Image
This works, I get an image on the screen, but when I try to use gotoAndPlay(frame) it fails, it does not move to any other frames because (I think) it does not treat this class as a movie clip, even though in Flash CC the base class is movieClip.
By the way also filters, for example dropShadow, which I apply in Flash CC for this movie clip, are disregarded. Don't know if this is related issues.

As I originally suggested it should be:
public class MyCow extends MovieClip
- but in this case the object does not appear on the screen at all.

I am confused. Could you please explain how to combine showing on the screen of a movieclip from SWC with possibility to gotoAndPlay(frame). Because for me it seems they self exclude.

Is there any examples on this site of what I am trying to achieve? Because I think it is very easy thing and I simply need a simple example here.

P.S. I found a thread where you ask to make sure the animation is not in submovie clip. In my case they are not, I checked of course.

UPDATE: I think, I know what went wrong for me. I am using Event.ENTER_FRAME to control actions of my characters.
Code:
this.addEventListener(Event.ENTER_FRAME, turnMeOn);

And animation most probably simply has no time to play before next ENTER_FRAME... Now I am thinking how to solve it.

Sorry, if this forum is not a correct place to ask for help in such situations. If one knows a better place please share with me. Otherwise I will be happy to get some advise.


Fri Jul 04, 2014 1:22 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
You are on the right track: user class Cow extends SWC class MyCow; this is exactly the right pattern.

Now what can fail is for instance you call gotoAndPlay in Cow's constructor while you have a 'stop()' action on MyCow's first frame timeline: the timeline code will get executed after gotoAndPlay and basically cancel your command.


Sat Jul 12, 2014 3:32 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 8 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.