Archive

Posts Tagged ‘flash’

Bullying for ‘grownups’ : Apple vs Adobe

May 2nd, 2010 Heeties 1 comment

So a lot has been going lately with adobe and and apple. A lot of Flash developers around the world (including myself) were looking forward to adobe’s next release of CS5. From all the new features they are introducing for the flash platform, one specifically got a lot of attention. The iphone packager for Flash CS5.
I was very excited about this new feature so we finally could get flash running on iphone/ipod touch/ipad devices and a lot of ideas were already brewing.

But then a few days before the official announcements for Adobe’s new Creative suites began (CS5) apple changed the policy for their apps.

This is the part where it goes wrong for Adobe:

3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

And this quite sucked for Adobe as their promotional video’s were already recorded and ready for broadcast and thus at the day of the announcements the part about flash still included the iphone packager.

A few days later Rumors went that Adobe was preparing a lawsuit against Apple.

Again a few days later Steve Jobs made a blog post about Flash and that HTML5 is the new ‘holy grail’ that they are going to support. But after seeing this i cried a little.

Later in the same week Adobe announces that they put a stop to the effort to get Flash to iphone and ipad devices.

So what the hell are you people doing!

Because let’s be honest who is going to pay for this? That’s right the developers.
If we want to create iphone/ipad apps we need to adapt ourselves and learn a new language in order to do that. I’m not saying that change and evolution are bad. We need it to keep fresh and on our toes. But this is ridiculous, first letting Adobe almost release new functionality and then giving them the royal finger by declining every app made by the packager just before they release it. That’s kind of low apple, shame on you.

When I see everything that is going on between Apple and Adobe it’s like two children fighting. I wonder if at the sidelines we have Microsoft and Google laughing at it and enjoying a bag of popcorn. The worst of it is that the real people getting hurt are the ones working with and using both of the companies soft- and hardware.

As someone who works with Adobe products (Photoshop, Illustrator, Flash, Flex, Dreamweaver, Coldfusion, .. ) on a daily basis i was very disappointed in apple’s decision to decline flash made apps. On the other hand I use apple products too (ipod, iphone and just ordered a new macbook pro). I’m just saying i am not connected to either company and i ask myself where is this going. I think they both should ‘shake hands and share a cookie’ and work on the Flash <> i’Someting’ issues.
I see many opportunities getting lost to both companies in fact i am quite sure both Apple as Adobe are losing the battle. Now it’s not a matter of are you pro or against apple (as in buying an iphone vs let’s say an Android device). But it’s going to be a much tougher decision with flash now certainly almost never being enabled on the apple devices. Is the Android market place going to expand much faster compared to the Apple’s app store and so on.

At the moment i am an happy iphone user but if foolishness continues there is a good chance my next phone won’t be one made by apple…

Categories: Adobe, flash, Flex Tags: , , ,

Setting up Projects in Flashdevelop – Part 1: Flash

January 23rd, 2010 Heeties 3 comments

To write actionscript code for a I use Flashdevelop, it’s an IDE to write AS2 , AS3 and mxml code (also HTML, CSS, HaXe, jscript, phyton and XML are supported)  . It’s open source so it’s free and it’s I think it works extremely well.

In the past I always used to write all my AS in Flashdevelop and compile in the normal Adobe Flash IDE which works fine but is a bit cumbersome to work with if you only use the Flash IDE to create graphics and maybe some timeline animations. I wanted to be able to compile my Flash application in FlashDevelop.

First off all you need to download three things to get this working.

1. Flashdevelop:

You can download the newest release here. But unfortunately it’s currently only available for Windows users. There is a tutorial here to get it running on a mac thru parallels. In this tutorial I’m using Flashdevelop 3.0.6 RTM

2. Flex SDK
I used 3.5 for this tutorial, download here.

3. Flash player 10 projector content debugger
Download here.

For this example we’re going to set up a AS3 project. So after you installed flashdevelop, create a new AS3 project.

I named my project ‘flashinfb’ for this tutorial.

Just put it on a location you want and click ‘ok’.
Flash develop created a few folders (bin, lib, src ) in your project folder. Your project will be compiled to the bin folder. your source code (AS files) go in the src folder and library items (like swc files) go in the lib folder.

Extract the Flex SDK zip to a folder of choise. Please note that Flashdevelop will need this SDK to compile your code, the files will have to remain on your hard drive. So you might want to put it in a folder that stays the same and is a bit organised for you, e.g. the desktop is not a good idea to put them.

After you extracted the files. In Flashdevelop go to Tools > Program Settings .
Choose the AS3 Context and change Flex SDK Location to the path where you put the Flex SDK just now.

After you are done just click Close.

Now you need to run the Flash Player Projector you downloaded earlier.  Just double click it and then close it again. Go back to FlashDevelop and open Project > Properties. In the output tab change ‘Test Movie’ to  ‘Play in external player’.

Then just click ‘Ok’ for now.

If you look in Flashdevelop in the src folder you notice there was a Main.as file created. If you right click on it you see the ‘Always Compile’ checked. This means this is the default/root AS file your project will compile to. It’s about the same as the Document Class in the Flash IDE.

Now by default if you would press ‘Test movie’ (F5) you notice that the .swf created in the bin folder has the same name as your project name. You can chance this by going to  Project > Properties and change the ‘Output file’. I renamed mine  to main.swf .

You can test your movie now by clicking the ‘Test movie’ icon,  go to the menu Project > Test move or just hit F5.

An empty white flash player window pops up. In your output window of Flashbuilder you see some compile information. Also everything you trace will be in the output window.

Now the question comes, you don’t have any .fla files in your project how can I create a library of objects and graphics without a fla. Before you compiled via Flashdevelop that was done in the fla you compiled and had your library in there.

In Flash created a new file and drawn a 20×20 square on the stage and gave it a color (other than white). Then I made the square a movieclip and entered the following :

Click ‘Ok’ and then right click the movieclip just created in the library and pressed ‘Export SWC file’.

Browse to the lib folder of your flash project and create the SWC.

In Flash builder go to the lib folder and right click the .swc file and make sure you check ‘Add to Library’.

In the image below you see that I saved the .fla file in the lib folder of my project but that is not necessary, you can save that file anywhere you like.

And now you are able to use swc file to get library objects.

The example below is the whole Main.as file with some extra code to use the movieclip inside the .swc file.

The code just fills the stage with squares with a random alpha value.

package
{
        import flash.display.MovieClip;
	import flash.events.Event;
 
	/**
	 * ...
	 * @author Ben Eelen - Heeties
	 */
	public class Main extends MovieClip
	{
		public function Main():void
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(e:Event = null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
 
			/* tutorial code */
			for ( var i:uint = 0 ; i &lt; ((stage.stageWidth / 20) * (stage.stageHeight / 20)) ; i++) {
				var square_mc:Square = new Square();
				square_mc.x = (i % (stage.stageWidth / 20)) * 20 ;
				square_mc.y = Math.floor( i / (stage.stageWidth / 20) ) * 20 ;
				square_mc.alpha = Math.random();
				this.addChild(square_mc);
			}
		}
	}
}

Of course you can also use a .swf instead of a swc to load some external library items.

So compile the fla file you used to make the swc earlier. and put the resulting .swf in the lib folder  of your project.
To make this work you need to embedthe compiled .swf in this example graphics.swf and define the symbol you want to use that is in the swf.
and make it a Class like this:

[Embed (source = "../lib/graphics.swf", symbol = "Square") ]
private var Square:Class;

You also need to change the way you define your symbol (compared to the example with the swc file);

var square_mc:Sprite = new Square();

The full Main.as code looks like this:

package
{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
 
	/**
	 * ...
	 * @author Ben Eelen - Heeties
	 */
	public class Main extends MovieClip
	{
		[Embed (source = "../lib/graphics.swf", symbol = "Square") ]
		private var Square:Class;
 
		public function Main():void
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(e:Event = null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
 
			/* tutorial code */
			for ( var i:uint = 0 ; i &lt; ((stage.stageWidth / 20) * (stage.stageHeight / 20)) ; i++) {
				var square_mc:Sprite = new Square();
				square_mc.x = (i % (stage.stageWidth / 20)) * 20 ;
				square_mc.y = Math.floor( i / (stage.stageWidth / 20) ) * 20 ;
				square_mc.alpha = Math.random();
				this.addChild(square_mc);
			}
		}
	}
}

So now you are fully ready to build a project and use FlashDevelop as a Compiler instead of Adobe Flash IDE.

Categories: Adobe, flash, FlashDevelop Tags: ,