Posts Tagged FlashDevelop

haXe, NME, RobotHaxe, Git, GitHub, brains exploded

Hell yeah! Crazy day. Spent all day figuring stuff out, now I’m pretty tired but I have to share my findings.

NME, a cross-platform solution

So, I am looking for a true cross platform development solution that will give me output for iOs, Android and Web (Flash). Using Flash and Air is too slow for me, but I do like ActionScript 3 a lot so NME seems like the logical solution. What is exactly NME? You know what? I don’t really know. It uses haXe and I think haXe is a programming language based on ActionScript. NME can compile both to Flash and C++ (and many more). That is as much as I could figure out, but I’ll keep digging.

Installing haXe and NME seemed pretty straight forward and it seemed to have worked, the only trouble I had was with FlashDevelop. Syntax high lighting is all off and it doesn’t seem to find where the classes are. But it compiles so I could at least get some stuff done.

From ActionScript to haXe

Actually that part isn’t that bad, there are little differences which you can find on this cheat sheet, but there are also concepts that are totally oblivious to me like the Dynamic type. But I just rolled with it and everything kept working, so this is something I’ll figure out later too. Little annoying thing every class needs a constructor (but at least the function name is only “new”) and if you extends something, you have to call super. Also, I noticed that on the NME Sprite (nme.display.Sprite), there is no rotationY property (well this is particular to NME, and I have never used rotationY before until 2 days ago, so I find this very funny).

On to RobotHaxe

Well I can’t really do anything without Robotlegs. I like how simple things are with it and well organized, so if I was going to move to another language, it needed to have Robotlegs. Period. Well I also need to be able to embed Fonts, have a Tweening engine and something to replace timeline animations, Robotlegs is the most important. Turns out there is a port to haXe called RobotHaxe made by David Peek. The only problem, there is no documentation, no examples, no tutorials… I decided to give it a shot anyway, how hard could it be? Kinda hard… haha. Anyway I got it to work, not sure it is the best way to do it, but it works (for what I have tested). I made this test RobotHaxe project using FlashDevelop and NME, not sure what it implies but I think it can be useful to people so I am giving it to you.

Git and GitHub

I never used Git before, always used SVN so that was new territory also. I also used to make a zip file and give my sources like that, but I figure GitHub is a better solution since you can browse before downloading. Anyway I put my test project on it. So go check it out here : Example RobotHaxe Project for NME and give me feedback or tell me how I could do it better, because I really don’t think it is perfect. But it is better than any other example out there. ( I know there is a bunch of guys using RobotHaxe for JavaScript, but the code I have seen from them wouldn’t work in Flash so it wasn’t really helpful)

, , , , , , , , ,

10 Comments


My game on a iPad, my pilgrimage

YEAHH! Pretty nice is the feeling you get when you see your game for the first time on the medium it is supposed to be. Yesterday I dwelled in the mysteriously complicated world of signing applications for the Apple App Store. 6 hours it took me to finally get my game on my tablet ( by the way I didn’t buy the iPad, I won it :) ). I would say that 2/3 of that I was stuck in Apple developer center where you have to do numerous steps and get many files in order to sign your app / game. The last third came from converting one certificate to something Flash can use to compile a .ipa file.

For that step you can either do it on OSX or on Windows differently and since I have both installed on my machine, I thought I would do it the easy way ( what I thought would be) on OSX, but for some reasons Keychain access didn’t seem to export me the right things. So I had to do everything using OpenSSL on Windows, which after a little tweak, worked like a charm. Follow these instructions from Adobe to do so: generate signing request, convert certificate to .p12.

So with that done, I was set to compile my Flash game into an iOs app. This proved also more complicated than what I thought. My game was built using FlashDevelop, but I have Flash CS5.5 so I thought it was just a matter of setting my main class as the document class of a new fla. Turns out the Flash compiler is different from the Flex compiler and it started throwing me a lot of weird errors. I have to admit my project is a bit weird too (I lost one fla, so I had to decompile one file but I couldn’t get the font out of it, so I have 2 swc that have symbols in common), but it should have worked. Anyway, you don’t need Flash to compile to iOs. I downloaded the new Flex SDK and the latest AIR SDK (4.6 and 3.1) and used those templates for FlashDevelop and it worked mighty fine. Funny thing, my game was already compiled using the Flex 4.5.1 SDK; not AIR  (I am not using anything special) and not the latest SDK, but I didn’t have to recompile it, I just packaged it and it worked fine. I wonder if I use the AIR compiler instead if it would run faster???

, , , , , , , ,

3 Comments


Robotlegs FDT 4.2 project template

FDT 4.2 introduced an improved project template system so since I already did some Robotlegs templates for FlashDevelop previously, I thought I would give it a shot for FDT too. So here it is:

FDTRobotlegsProjectTemplate

Copy those file in this folder for MAC users

(Your User Name) > Library > Application Support > FDT > projectTemplates > Web

and in this folder fo PC users

C:\Users\{Username}\AppData\Roaming\FDT\projectTemplates\Web

After that all you have to do is create a new Flash project in FDT and you should see Robotlegs project under web.

All you have to do is specify the package name by entering the client name and the project name and there you go, you have a fully functional Robotlegs project. I did the client+project package name thing because if you work for an agency you could do multiple projects for the same client so I think it is better for code organisation.

This template includes:

  • a SiteMain file which is the file that you will compile
  • a SiteContext
  • an ApplicationModel
  • a CreateMediatorCommand
  • a StartupCommand
  • a SiteEvent class
  • and a SampleView and SampleMediator

You could remove the SampleView and the SampleMediator but I felt it made the project more complete and a really good Robotlegs example.

If you have suggestions on how to make this template better or just comments, leave them down here.

, , ,

3 Comments


I am Flash Developer

This isn’t the next article I wanted to write but it was on my list since Flash In The Can Toronto (2010). It comes from all the talks surrounding the refusal from Apple to let Flash on the iPad ( i guess we can just say iOs now).  During that period a lot off people (including me) where uncertain about their future. I mean when someone as powerful as Steve Jobs tells you that your job shouldn’t exist, you think about it twice. Out of the turmoil that ensued, some voices touched me more than others. What they were saying is that they, as developers, weren’t tied to a technology and that if Flash was to disappear tomorrow, they would still have a job. That got me to think. A lot. The next thing that affected me was something I heard at FITC concerning designers. How they don’t call themselves ’Photoshop Designers’ or ‘Corel Draw Designer’ (I tried to think of another product than Adobe but just could come up with Corel Draw (who uses that anyway), but you get the idea). I think this follows a bit the same vibe as the comments from the Flash dudes.

All of this feed my reflexions, I mean I have tried a lot of technologies (all things in perspective, I am still at the start of my career, so I humbly say so). I have tried Java, PHP, MySQL, C, Flash, ActionScript 2 and 3, HTML/JavaScript/Css, Ajax, Asp, C#, Python. And you know what? There is nothing I like better than doing ActionScript 3. I mean the tools help a lot; FDT (yes I said it, I now like FDT) or FlashDevelop for code and Flash CS5 for visual assets. I like the workflow, I like making PSDs alive, I really like using TweenLite to make stuff move, I like figuring out how to build my applications so that they minimize load time and CPU usage (I also like maximizing CPU but don’t tell HTML5 fanatics, they know jack shit about pushing limits, yet, but they will know what I mean when they taste it, which will happen for sure). All of that I can’t get from any other technology to the extent that Flash does it right now.

It’s been 2 months that I am at B-Reel right now. I really love it, but the project that I am doing right now mostly doesn’t involve Flash ( I managed to stick a bit of Robotlegs in there) and is mainly Javascript/Html/Css. I really look forward to doing a Flash project. I really don’t want to do html ever again. I don’t have fun doing it (well I am just speaking about the technology, the project itself is amazing). Also, I feel the world of Flash is so deep and there is so much you can do to get better that if you learn all of the other technologies you can never get truly as good on the Flash Platform as one could be. For all of these reasons, that is why I am Flash Developer, that is my title and I am not ashamed or feel diminished by it. It really defines me.

With that being said, it gives me security. I think I am not alone in this situation. I think Flash gives a mean to express themselves to a lot of people and because of that, you can be sure that these people will produce tons of cool shit with it. And other people will want to see that cool shit. That gives a reason for Flash to be. Someday there will be Flash on the iOs. You can be sure of that (I mean Steve Jobs has an expiration date, right?)

, , , ,

19 Comments


And now an AS3 Project – Robotlegs project template for FlashDevelop

So yesterday I gave you files templates for Robotlegs. I now give you a project template. File templates are used when you want to add a new file to a project, project templates are used at the creation of a project. It will create the folder structure, add libraries and create the basic files you will need in most projects of that type.

In this Robotlegs project template I added 7 files : Preload.fla, Main.as, IMain.as, MainContext.as, CreateModelsCommand.as, CreateMediatorsCommand.as and ApplicationModel.as.

I added the Preload.fla because has explained in this post, I pass the loaderInfo(I do this to pass the flashvars) from the preloader to the loaded Main so I thought it would make understanding why I did that in the Main easier. This is a template preloader so there is no graphics in it, just the basic code to make a preloader work.

In the Main.as I also do some weird things, namely this:

if (Capabilities.playerType == "StandAlone"){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
init(this.loaderInfo);
}
 
//and this in the init method
if (Capabilities.playerType == "StandAlone"){
local = true;
}

I do this to test locally without having to compile the preloader every time. Also, I might need to know if I am local if I use AMF. In that case, the url for my gateway will be different.

For the rest, it is pretty straight forward, a MainContext for the application that will start it, a command to create the models, a command to create the mediators and finally an ApplicationModel. I don’t create the ApplicationModel in the CreateModelsCommand because I want to parse the data(parameters) inside of the LoaderInfo I passed in the constructor of the MainContext.

If you use this project template along with the files templates, you’re in for major time saving while enjoying Robotlegs!

Here are the files:
000 ActionScript 3 – AS3 Project with Robotlegs.rar

So when you downloaded the files, go in FlashDevelop, in the top menu select Tools and then Application Files… This will open the application files folder of FlashDevelop. Now go in the Projects Folder and add the files that you downloaded (copy the “000 ActionScript 3 – AS3 Project with Robotlegs” folder there). Now the next time you create a new project in FlashDevelop, scroll down and you will see it.

You may not agree with everything that is in those templates, then there is two things you can do. Either discuss about it in the comments or modify my project template. It is very easy to do so; I never even looked at documentation to learn how to do it.

, , ,

5 Comments


Robotlegs templates for FlashDevelop

I just finished my first project using Robotlegs and I can say I really like it. Way less code to write. The only thing that bothers me is that you have to create new Events when you want to pass around complex data but I think AS3Signals might fix that so I will look into that later on.

Since I have all my templates for PureMVC done in FlashDevelop, I thought I would do the same for Robotlegs. So I have built a template for a Command, a Context, a Mediator, an Actor and I also put in a ResizeModel (I know some people do this in a mediator but if you want to change this go ahead). Now, I don’t think these will be perfect, but it is a good starting point.

I am also working on a AS3 Project – Robotlegs template, but I want to try it out before I give it out. When I am pleased with it, I’ll post it along with an update of the other templates.

Here is the files with the templates:

RobotlegsTemplates.rar

To add them in FlashDevelop, in the Tools menu click in Application Files. This will open the folder where the applications files for FlashDevelop are. In there open the Templates folder, then the ProjectFiles folder, then the AS3Project folder. Now copy the Robotlegs folder you downloaded there. To use them, in the project view in FlashDevelop, right click on a folder, click “Add” and then Robotlegs. At that point you will see the five templates you just added.

Robotlegs Templates for Flash Develop

, , , , , , , , ,

6 Comments


Log, trace, log, release, log?

Ok, this title doesn’t make sense if you haven’t read the article which goes against the concept of title, but I find it funny!

So here I was looking for a solution to the problem I think every Flash Developer most have had: I can trace fine when I am in the Flash IDE but sometimes I need to test in the browser and then I loose my traces…

Easy solution: use a logger tool like Alcon or MonsterDebugger.

Problem: it’s annoying. When you are at the point where you need the extra logger you need to find the ActionScript classes to make it work blabla.

What I want is an elegant solution that when I test locally it uses the trace and when I test in the browser it uses the logger. I was already using the snippet for trace in FlashDevelop so I thought I could make a snippet that would have this if statement and do just that. My first bump in the road was the fact that I didn’t know how to add an import statement when using a snippet at a different place in the code.

So while looking in the FlashDevelop forums I came upon FDTracer. Well it doesn’t exist anymore, it was a pluggin before but it is now an integral part of FlashDevelop. Turns out I always had it under my nose but I never knew about it. It would be nice if in the interface they actually tell what it is and how to use it.

So here are a couple of pictures to show you where that logger is. In FlashDevelop, under View it is called Flash Log Viewer and is by default one of the tab at the bottom of the program:

What this thing does is that it reads the logs that the Flash Player writes on the computer. You see, when you put the final swf on the server and the user plays it in his browser, all of your trace statements are written in the log file. That is why leaving trace statement in your final release is not that good for performance. Anyway one last thing to know is that you actually have to start it before it works. So press the little play button and start seeing your trace.

What is cool with this little thing is that it will work locally and in the browser, you don’t have do to anything(execpt press play) to make it work. Also if you feel spyish you can check the trace from Flash website made by others.

So yeah, please clean your traces…

, , , , , ,

10 Comments


My verdict on FDT

I said I would try FDT for a month and I am sad to say that I did not find it superior to FlashDevelop. FDT has some good sides and even stuff that it does better than FlashDevelop, here are some:

  • compile errors while editing
  • debugger
  • ant support

But it has two major problems, first it is built on Eclipse which makes it much more complicated than it should be. Secondly it is very expensive (well I had more problems with it than just that, but these are the game changers). I don’t even understand why it cost so much… It even cost more than Flash Builder. Anyway that seems weird to me, but maybe it’s just me. Anyway in comparison to FlashDevelop which is free, it doesn’t stand a chance.

While venturing in the FDT world we came across templates, snippets and short keys. Those are very useful things when you use them. Templates are also time savers when you are using PureMVC because when you want to create a Mediator, all you have to provide it is the mediator name, and it’s view  name and type and it will generate the rest; no more copy paste from other mediator. Also project template are very cool. Snippets are mini templates, for example to generate getters and setters. Short cuts are combination of keys you press to do an action instead of going trough a menu to do the same action. Well, it just happens that FlashDevelop has all those things, but I just wasn’t using them… So out of all this I came out with increased efficiency.

FDT might still be a very good tool, mostly if you are already familiar with Eclipse, but for me FlashDevelop is still the way to go. If  FlashDevelop gets a Debugger than I won’t even ask myself the question.

, , , ,

11 Comments


New FlashDevelop beta version

This is just to tell you that there is a new version of the beta of FlashDevelop 3(ActionScript editor). There wasn’t any change since august 25th. I didn’t try it yet, but I soon will, it can only be better.

, ,

No Comments


9-slices scaling, Papervision 3D, Tweener and FlashDevelop

I am currently working on a website with tons of rounded corners, so I’m pretty happy they added 9-slices scaling in Flash 8. The only problem I had today, was that I wanted to apply 9-slices scaling on a mask and it happens that you just can’t. You can’t do it using ActionScript and you can’t use it using the Flash Authoring tool. I don’t know about flash 9, but I sure hope they will get that to work.

I also stumbled upon something that looks pretty cool: Papervision 3D . The name says it, you can use it to do 3D in flash, haven’t tried it yet but it looks sweet. And while browsing their website I found a nice example using Tweener which I spoke off recently. They’ll both deserve more investigation.

Finally, on the same project I am working with all those rounded corner I am using FlashDevelop. I use it because I find the Flash Authoring tool to be really bad (Flash 8 ) for ActionScript. Well I said FlashDevelop was good, but I would rectify what I said, and now say that it is still experimental. I had all sort of problems with it, mostly with the auto-completion tool completing things all the time which I didn’t ask for . Just thought I’d share that with you.

, , , ,

No Comments



Parse error: syntax error, unexpected ';' in /homepages/25/d169645162/htdocs/wp-content/themes/fusion/footer.php on line 13