Flash Player 10 is out!11!!!

May 15th, 2008 by Idoru

Adobe just released the beta version 10 of Flash Player, codename Astro!

You can get it over at the labs, and check out it's cool demos!

The biggest thing they also released as a beta was Pixel Blender, formerly Hydra, the new language that will enable us to write filters using the GPU.

Also they introduced a new parameter that enables us to take advantage of the GPU capabilities of the the user, this is truly a great day!

I can't wait to start playing with both Pixel Blender and the new native 3d features!!!

Links:
Demo - http://labs.adobe.com/technologies/flashplayer10/demos/index.html
Labs page - http://labs.adobe.com/technologies/flashplayer10/
Pixel Blender - http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

“SecurityError: Error #3015: Loader.loadBytes() is not permitted to load content with executable code.”

May 14th, 2008 by Ivan Valadares

In the last month I thought Adobe had protect the loadBytes method from the loader so that only “regular” files like mp3, jpg, etc could be loaded, lots of good library’s like Benjamin Dobler wav reader stop working. What I think it is that in last version of flash player Adobe turn allowLoadBytesCodeExecution to false. If you see Adobe documentation they have written “Note: This API is likely to be replaced in a future release of AIR.” If anyone knows what really happen let me know. Now the good part, to solve that is simple, you only need to set allowLoadBytesCodeExecution to true.

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

Loading an xml synchronous with Adobe Air

May 14th, 2008 by Ivan Valadares

I usually work in desktop application and we like it or not flash is optimized for the web so normally we have to put complete event ever time we load anything, and it’s logic, because for the web things have to be asynchronous but for desktop applications they not.
We have already load text and xml files synchronous and done some things with sql lite synchronous, I think for now images and sounds can’t be done, because even if you get the bytes, you always need to invoke loadBytes method from the loader and put a complete event listener, fuck! lol, I hope that in the next release of flash the loader have an synchronous method of load the bytes.

There it’s a class to load an xml file synchronous.

How to use:

var configXml:XML = XmlLoader.load("Config.xml");

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

Flash Player use of Internal clock

May 7th, 2008 by Ivan Valadares

Internal clock in flash player sucks a lot. I am doing a project that needs to have a lot of precision in the time intervals. The project is like a music sequencer, so the timer have to tick always at the same time, because if not you listen like an empty space between sounds. I have done some tests with the event OnEnterFrame and the Timer function, and the results are the follows: if you start a timer with 3000 milliseconds the results will be: 3045, 3072, 3000, 3305, 3079, 3063, 3081, so you have like 80 milliseconds of difference, it’s not good enough. I have done the same test in c#, and the results are 3000,3000,3000,3000. It’s a little bit sad, if anyone knows a solution, please comment.

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

Flash goes opensource

May 5th, 2008 by Idoru

Just read on Aral's blog that flash is going open source, this is great news! 
As Adobe will be opening up the AMF and the porting APIs for the flash  player. This means that we'll see flash in even more platforms and flavors, and will give projects like haXe a great boost!

Some reference links:
http://flashmobileblog.com/?p=91
http://aralbalkan.com/1332

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

Flash binary socket client & C sharp socket server

May 2nd, 2008 by Ivan Valadares

This week a friend of mine was making me questions about the binary sockets in flash, so I remember to post an example about it. I have been using a lot of XmlSockets for the last 2 years with the latest versions of flash, so it was really easy to implement binary socket because they are very similar. Binary sockets are really a great improvement in flash. I have seen a lot of implements like joysticks servers, connections to mail servers and so on; there are some examples on byteArray.org.

This example is a simple chat, it have a C sharp server and a flash client. Just click on socketServer.exe to start the server it will be listening on port 8000, then start client.exe and hit connect button. The server will accept multiple connections, so you can start more than one client, if you are testing it in different machines, just check IP address of the server and write it on the client Ip text Field and hit connect button.

The source code for client and server are on the example zip, it was done using Visual c# express 2008 and Adobe Flash 9.

Socket Example With Source Code

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

The MXMLLoader Class > Dynamic load MXML In Flex Builder 3

April 24th, 2008 by Ivan Valadares

First of all I don’t really use flex to do flex stuff and I’m not a big fan of flex. But in my latest project I had to build with flex an interface witch would be always diferent (a dynamic interface). In the beginning we thought in parsing some type of XML, but if we are in flex why not parse MXML? I took a look over the internet and I only found MXMLLoader component v0.01, witch didn’t compile on flex builder 3 and was really in the beginning. So there it is, as XMMLLoader class for flex builder 3. You just have to instantiate the class with the mxml :

You can access objects by name:

Or by id:

And have access to component events like:

The class with an example:

mxml-loader.zip

Example swf

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

Load an external flex swf into a flash project and communicate with him.

April 15th, 2008 by Ivan Valadares

Loading the swf is easy; you can make a normal loader and load it. And now the tricky part, if the swf is a swf flash file you can call the function you want, but in flex, because it have 2 frames, (first frame is just for loading), you need to wait until frame 2 is available, you can’t also access directly to a swf, you have to refer application before, so there’s the code:

you can also add Event Listener's to myClip.application , like myClip.addEventLIstener(“ON_CHANGE”,function), so by this way you can embed flex swf into an flash application and communicate with him by calling function and receiving events.

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

Global Mouse_Down Event

March 29th, 2008 by Ivan Valadares

A time ago I had I little problem, I was doing an application and it had some severed changes, at some point I hasn’t capable of detect some mouse down events because I had a lot of sprites inside of sprites inside of movieClips with lots of event listeners and so on. So I and Hugo found this solution. Basically you put a generic mouse down event on stage and pass an array of objects with the name of the display object you want to catch the event and the name of the function you want to call. One good thing is that you can catch more than one event at the same time even if the displayObjects are in front of another displayObjects.

Note: this is really bad programming, if you can don’t use it, use only in severe cases.

globalmousedown.swf

globalmousedown.zip

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo

hitTestObjects

March 28th, 2008 by Ivan Valadares

This function can be used to test a hit between a displayObject with an amount of displaysObjects (Array). It will return the displayObject where the biggest contact area occurred. Note: it uses the bounding boxes.

hittestobjects.swf

hittestobjects.zip

Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Furl Yahoo Newsvine Spurl Squidoo