getters setters and more in flash develop

In Flash develop 2 there was a useful plugin for automatically generating getters and setters.

Now in Flash develop 3 beta 6, the feature is now inbuilt along with a whole lot more features… http://www.flashdevelop.org/wikidocs/index.php?title=Features:Generation

The shift+ctrl+1 combination feels a little cramped for a shortcut that I would use a lot, but if it bothers me enough I’ll go change it in the settings.xml file.

One of the generation that impressed me is that it generated the onButtonRelease a function from the line button_mc.onRelease = Delegate.create(this,onButtonRelease); (I was writing as2)

Posted in Programming | Tagged | Leave a comment

No _ in air id for the application file

I’m putting a sample together for a question that was asked at the Brisbane flex/air launch.

I called the project air_photodemo which puts that as the ID for the app file.
<id>air_photodemo</id>
The compiler was throwing an invalid application descriptor: invalid application identifier

Change the id to <id>airphotodemo</id> and compiler is happy.

Thought I would post as it stumped me for a few min.

Posted in Programming | Tagged | 3 Comments

Flash Develop 3.0 Beta 6 has been released

Flash Develop is my IDE of choice when working with actionscript. You can write both AS3 and AS2 using either flash to compile or the Flex SDK (only AS3).

Flash Develop is free and open source, though remember donations help to keep the project alive.

The later betas are stable enough to use in a production environment.

Here are the new release notes:

http://www.flashdevelop.org/community/viewtopic.php?t=2574

I think this one is my favourite:
” * Captures Flash CS3 compiler errors in FD results panel when CS3 is called from FD “

It might not sound like much but it will increase my workflow. At the moment it is write from Flash Develop, press compile, flash does it things and compiles but the errors are presented in flash. You then need to read the compile errors in flash and then find the line number in flash develop. If the errors are in flash develop then all you need to do is double click the error to go to the line.

It is obvious that the developers of flash develop code in it as there are some really neat features that speed up work. For example Quick find (like firefox’s search) and code completion doesn’t need to match the first part of the word eg if your are looking for .maxVolume typing volume still gives maxVolume in the list.

If you are coding AS2 and/or AS3 download and try it. It will change your life!

Posted in Other | Leave a comment

Colin Moock is coming to Sydney

The Sydney date for the AS3 tour has finally been announced! It will be may 5th, which happens to be the same week as webdu. I guess I have to be extra well behaved at work to see if I can go to both events ๐Ÿ˜€

Posted in Other | Leave a comment

Blur

I’m currently reading through a couple of tutorials on how to create a water effect I want. One of them starts with a blur function which is pretty easy to understand in concept but I wanted to see the result. So I wrote the formula in hydra.

gyatt park

gyatt_blur.jpg

kernel Blur{
    void evaluatePixel(in image4 src, out pixel4 dst){
        float2 coord = outCoord();
        float4 source = sampleNearest(src,coord);
        float4 source1 = sampleNearest(src,float2(coord.x+1.0,coord.y));
        float4 source2 = sampleNearest(src,float2(coord.x-1.0,coord.y));
        float4 source3 = sampleNearest(src,float2(coord.x,coord.y+1.0));
        float4 source4 = sampleNearest(src,float2(coord.x,coord.y-1.0));
        float4 final = (source+source1+source2+source3+source4)*0.2;
        dst = final;
    }
}

The code gets the pixel of the current pixel along with the top, right, bottom, left and then divides by 5 to find the average.
Flash already has an inbuilt blur filter but this was just to see the maths.

Loops are not supported when Hydra is used within flash, so I can’t think of a way that you could increase the blur via a parameter at the moment.

Posted in My projects | Leave a comment

update to wiggle hydra example

I decided to add frequency into my wiggle hydra example. Frequency adjusts the distance between a wave making wider or shorter waves. The old one only let you change the amplitude of the wave on the x and/or y.

kernel morph
{

parameter float xangle< minValue: 0.0;
    maxValue:10.0;
    defaultValue:5.0;
>;
parameter float frequency< minValue: 0.0;
    maxValue:2.0;
    defaultValue:1.0;
>;
parameter float yangle< minValue: 0.0;
    maxValue:10.0;
    defaultValue:0.0;
>;

    void evaluatePixel(in image4 src, out pixel4 dst)
    {
        float2 coord = outCoord();
        float xcoord = coord.x - sin(coord.y*frequency)*xangle;
        float ycoord = coord.y - sin(coord.x*frequency)*yangle;
        dst = sampleNearest(src,float2(xcoord,ycoord));
        if(dst.r==0.0&&dst.g==0.0&&dst.b==0.0){
           dst = sampleNearest(src,outCoord());
        }
    }
}
Posted in My projects | Leave a comment