View unanswered posts | View active topics


Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Visual FlashDevelop v0.3 
Author Message
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Visual FlashDevelop v0.3
Visual FlashDevelop version 0.3

Are you tired of editing your ActionScript 3 code by hand? Need a place to start, but you don't know how? Introducing Visual FlashDevelop. This plugin allows you to edit *.vfd files, and generates ActionScript 3 code. This is not meant to be a replacement for learning ActionScript, but a help.

PLEASE NOTE THAT THIS IS STILL AN ALPHA RELEASE. ALTHOUGH I DO NOT KNOW ANY BUGS, THEY MAY EXIST!

Features:
- Design rectangles and ellipses. Choose background and border colors. You can even set the border line thickness.
- Use an intuitive interface. For example, the "Delete" key deletes the currently selected object, as expected.
- Assign mouse events to your shapes.
- Assign ADDED_TO_STAGE, ENTER_FRAME and REMOVED_FROM_STAGE events [NEW IN 0.2]
- Save/Load working correctly. Generated AS code works perfectly.
- Add Images to your visually designed sprites. [NEW IN 0.2]
- Visually resize elements. [NEW IN 0.2]
- Specify the location of the generated file (file.as) [NEW IN 0.2]
- Text Field element [NEW IN 0.3]
- Keyboard events [NEW IN 0.3]
- Undo/Redo support [NEW IN 0.3]


Future features:
- Button and CustomMovieClip elements
- Clipboard
- Visually move elements
- Create event functions draft
- Multi-selection of elements

Download version 0.3: http://luiscubal.googlepages.com/VisualFlashDevelop-version0.3.dll
Download 0.3 source code, under the MIT license: http://luiscubal.googlepages.com/VisualFlashDevelop-0.3sourcecode.zip
Download version 0.2: http://luiscubal.googlepages.com/VisualFlashDevelop-version0.2.dll
Download 0.2 source code, under the MIT license: http://luiscubal.googlepages.com/VisualFlashDevelop-0.2sourcecode.zip
Download version 0.1: http://luiscubal.googlepages.com/VisualFlashDevelop-version0.1.dll

Install instructions:
To install it, open the FlashDevelop application data folder, choose "Plugins" and place the DLL there.

To use:
Just create an empty *.vfd file and open it in FlashDevelop.


Last edited by luiscubal on Sat Sep 27, 2008 4:59 pm, edited 4 times in total.



Sat Aug 23, 2008 10:51 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 10740
Location: Paris, France
Post Re: Visual FlashDevelop v0.1
Good job so far.

Except for the generated code:
- incorrect package/class/constructor declarations,
- DO NOT set the width/height of any element (this is seriously wrong),
- create Sprite elements instead of MovieClip,
- as far as simple drawing are concerned you could even use Shape elements (only drawing, no interaction),
- do not draw a background by default,
- events properties should probably be a simple string field where you write a function name (you could generate this function too).

Did you think about handling more complex situations? Like nested VFD, embedded images/SVG, etc.

PS: great to see that only the "generated code" part is overwritten.


Sun Aug 24, 2008 8:21 am
Profile WWW
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Re: Visual FlashDevelop v0.1
"incorrect package/class/constructor declarations"
Exactly what do you mean? The package and the class name are not overwritten, so they are very easy to fix. VFD doesn't know how to set the package automatically because it is not part of the generated code section.

"DO NOT set the width/height of any element (this is seriously wrong"
OK. I'll fix that

"create Sprite elements instead of MovieClip."
That can be fixed. But is there any reason for that?
EDIT: Fixed. v0.2 won't have this problem.

"- as far as simple drawing are concerned you could even use Shape elements (only drawing, no interaction)"
No. Because then there would no longer be events.

"- do not draw a background by default,"
I draw the "extern" movie clip background by default, but only a transparent background. I did this to assure the minimum size.
For example, if your movie clip had 800x600, but it only had a rectangle in (0, 0) of 100x100, then the width would actually be only 100x100. This transparent background prevents this.

"- events properties should probably be a simple string field where you write a function name (you could generate this function too)."
But what if you wanted to have multiple functions for one single event? Well, I guess that could make the editor easier to use. I'll reconsider.

"Did you think about handling more complex situations? Like nested VFD, embedded images/SVG, etc."
Nested VFD is something I'd love to make, but not yet. I don't think it would be too hard to implement.
Embedded images? It depends. Do you mean having an image in the project then importing it to the clip(or sprite) or do you mean CONTAINING images in the XML file? If it's the first case, then sure. If it's the second case, then it'd probably be a "no".
Also, SVG drawing would be very hard. I'll think in that later.


Sun Aug 24, 2008 12:05 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 10740
Location: Paris, France
Post Re: Visual FlashDevelop v0.1
"incorrect package/class/constructor declarations"
Code:
package <name of package> {
  public class <name of class without package> {
    public function <name of class without package> {
    }
  }
}

Maybe, like in .NET, content building could be moved into a method.

"create Sprite elements instead of MovieClip."
Of course there is a good reason: MovieClip is a superset of Sprite with ONLY frame-related properties and functions. This is really only useful when Flash creates a multiframe content, in all other situations these frame-related properties are useless, so stick to Sprite unless you have a good reason to use MovieClip capabilities.

"- as far as simple drawing are concerned you could even use Shape elements (only drawing, no interaction)"
It can be an option: you don't always need events on everything. Shapes offer a great performance improvement over Sprite.
Actually it will usually be more useful to set events directly on the container itself instead of children.
PS: do not forget important events like:
- Event.ADDED_TO_STAGE / Event.REMOVED_FROM_STAGE (very important, especially if you don't know why ;))
- Event.ENTER_FRAME

"- do not draw a background by default,"
I have the feeling that you misunderstand Flash's width/height concept. Your container doesn't need a minimum width/height because this information is useless, unless you need it for some good reasons (like components layout). So by default you shouldn't draw anything in the background.

"Did you think about handling more complex situations? Like nested VFD, embedded images/SVG, etc."
For embedded images/SVG I think of AS3 embedding at compile time, declared using the [Embed] meta tag.


Sun Aug 24, 2008 1:18 pm
Profile WWW
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Re: Visual FlashDevelop v0.1
But I use the standard package/class declarations...

I will add Event.ADDED_TO_STAGE in 0.2

I will add an optional "Force minimum size" option.

Yes, I'm using [Embed] in 0.2 bitmaps


Sun Aug 24, 2008 2:07 pm
Profile
Member

Joined: Thu Feb 09, 2006 10:58 am
Posts: 943
Location: Israel
Post Re: Visual FlashDevelop v0.1
Ah its nice... I can see how this could be useful to some extent....

Some suggestions:

put all the generate code to a private "create" class and call it from the constructor.

If I'll use this tool it would not be for drawing, but for layout, I still prefer to draw in flash. so having the exact mesures of things is very importent.

Off course add option to rename the clip, Choose its type (insted of being hars coded like MovieClip or sprite), and more....

By the way, after closing the plugin pannels, I can get them back. Maybe have them open with the vfd file and close when its closed.

_________________
MovieClipCommander


Sun Aug 24, 2008 6:31 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 10740
Location: Paris, France
Post Re: Visual FlashDevelop v0.1
That's true that I don't see this tool become a true graphics editor - but that would certainly be interesting to be able to place custom types.

You could optionally set the component width/height but it should not be mandatory because a lot of graphical objects shall not be sized but only scaled (this should be default behavior).

Note that you can use ASCompletion to resolve the type model and allow to set it's properties.


Sun Aug 24, 2008 7:49 pm
Profile WWW
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Re: Visual FlashDevelop v0.1
Here is a sample v0.2 code:

Code:
package{
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.events.MouseEvent;

    public class Name extends Sprite
    {

        public function Name()
        {
            InitializeComponents();
        }

        //[AUTOMATICALLY GENERATED - DO NOT MODIFY]
      [Embed(source='Waterfall.jpg')]
      public var image6771Class : Class;
      public var image6771 : Bitmap;

      [Embed(source='Creek.jpg')]
      public var image3321Class : Class;
      public var image3321 : Bitmap;

      public var rectangle3547 : Sprite;

        private function InitializeComponents():void
        {
         image6771 = new image6771Class();
         image3321 = new image3321Class();
         rectangle3547 = new Sprite();

         image6771.width = 545;
         image6771.height = 415;
         image6771.x = 16;
         image6771.y = 62;


         image3321.width = 476;
         image3321.height = 312;
         image3321.x = 141;
         image3321.y = 38;


         rectangle3547.graphics.lineStyle(1,0x000000, 1);
         rectangle3547.graphics.beginFill(0xffffff, 1);
         rectangle3547.graphics.drawRect(0, 0, 319, 359);
         rectangle3547.graphics.endFill();

         rectangle3547.x = 60;
         rectangle3547.y = 52;



         addChild(image6771);
         addChild(image3321);
         addChild(rectangle3547);

            //Let's assure the size of the main clip
            graphics.beginFill(0xFFFFFF, 0.0);
            graphics.drawRect(0, 0, 800, 600);
            graphics.endFill();


            width = 800;
            height = 600;
        }
        //[END OF AUTOMATIC CODE]
    }

}


As you can see, width/height is only set for bitmaps and the extern sprite. That "graphics.beginFill(0xFFFFFF, 0.0);" is ONLY called because in the visual editor property "Force minimum size" is set to "True".

I will deal with names now and I'll add some more features before 0.2.


Sun Aug 24, 2008 8:22 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 10740
Location: Paris, France
Post Re: Visual FlashDevelop v0.1
luiscubal, again, please hear me:
- width/height are SHORTCUTS to scaleX/scaleY, nothing more,
- NEVER set width/height of ANY graphical elements.

With ONLY ONE exception: "components". These are the only, really unique, elements that you will size.

Technically, components have a default (or minimum) size so when you set their width/height they can measure the bounds you want them to layout to. Then they reset their scaleX/scaleY to 1 and re-layout their content to FIT the width/height you wanted.


Sun Aug 24, 2008 9:05 pm
Profile WWW
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Re: Visual FlashDevelop v0.1
What if I WANT to scale my images? They can be shortcuts, but are they harmful if used knowing that they are shortcuts?


Sun Aug 24, 2008 10:46 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 10740
Location: Paris, France
Post Re: Visual FlashDevelop v0.1
luiscubal wrote:
What if I WANT to scale my images? They can be shortcuts, but are they harmful if used knowing that they are shortcuts?

Ok but you set the size ONLY if you want to scale the image. I'm talking conventions: in C# it is correct to give elements a size, but not in Flash.

It will only be "generally harmful" - there are many situations where it will size things incorrectly: imagine your content is bigger than 800x600: settings width/height to 800x600 will scale down everything unexpectedly.

Keeping scale to 100% is a very important thing in Flash because a very little change can make everything look like crap. Setting widht/height is a risk you should not take unless you know why you do it.


Mon Aug 25, 2008 7:02 am
Profile WWW
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Re: Visual FlashDevelop v0.1
Version 0.2 will already include several size control options.
For example, you have two new options for the extern object: Force Minimum Size and Scale.

Force minimum size assures that the extern object has AT LEAST the specified size(it draws the transparent background)
Scale assures the extern object has the specified size with the "width = " and "height =". Both are set to false by default.

Images also contain a scale property.


Mon Aug 25, 2008 11:30 am
Profile
Member

Joined: Thu May 15, 2008 7:36 pm
Posts: 605
Location: Baltimore, MD
Post Re: Visual FlashDevelop v0.1
Trying out plug-ing, forgive my ignorance but I'm stuck at your "to use" instruction which is: "Just create an empty *.vfd file and open it in FlashDevelop."

How do I create an empty .vfd / What is a .vfd?

_________________
http://tronster.com


Tue Aug 26, 2008 1:07 pm
Profile WWW
Member

Joined: Thu Aug 21, 2008 10:13 pm
Posts: 119
Post Re: Visual FlashDevelop v0.1
Just create an empty file with notepad and add .vfd in the end of its name.
.vfd means Visual FlashDevelop. It is the file format of this plugin.


Tue Aug 26, 2008 6:25 pm
Profile
Member

Joined: Thu May 15, 2008 7:36 pm
Posts: 605
Location: Baltimore, MD
Post Re: Visual FlashDevelop v0.1
luiscubal: Thank you, I was able to get it up and running. Would you generate some documentation on how to use this; all I have figured out to do on my own is draw rectangles and ovals... I can't figure out:
- How to generate code
- How to change properties (line width / color / etc...)
- How to connect objects (dervive a class from another)

_________________
http://tronster.com


Wed Aug 27, 2008 1:35 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 30 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 guests


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

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