Silverlight creating ZIP files in MAC
Posted by Helmut | Filed under AS Burst
If you are creating a Silverlight document in a MAC be aware that if you create a ZIP file from the Finder context menu "Create Archive of..." every time you try to access the files inside the ZIP file with Silverlight it will fail. Why? Not sure but I would assume something to do with the way MACs compress files compared of how PCs do. One way to get around this issue is by creating your ZIP files with "DropZip", you might be able to create ZIP files with a different program that will run fine with Silverlight.
//Silverlight error AG_E_RUNTIME_METHOD 2207
Posted by Helmut | Filed under AS Burst
I am doing some testing with Silverlight (I know right!) and I kept getting error #2207 without really getting a detailed description. Well the issue -in MY case- was hat i was trying to download a file cross-domains, and with most plugins it was a no-no. So I just needed to change the source to local file.
- Good:
- downloader.open("GET", "image-4.jpg");
- Bad
- downloader.open("GET", "http://www.helmutgranda.com/images/image-4.jpg");
Adobe Air SQLError: ‘Error #3119: Database file is currently locked.’, details:’null’, operation:’execute’
Posted by Helmut | Filed under AS Burst
For the longest time I was having issues with this Adobe Air Error and its description, the main issue is that the "details" for this error are "null". We do get the description that the database is locked but no details on file name where the error occur or line number.
If you do a search in the Adobe documentation you will get a pretty blank line after the error:
3119 Database file is currently locked.
To solve the issue once and for all what the error means is that you have a connection open to make changes to the database and you have opened a new connection to make more changes to the database. So there are 2 solutions
1. Use the first connection to make your second updates
2. Close the first connection and then you can use the new connection
Adobe Air CreateDirectory common error
Posted by Helmut | Filed under Tutorials
If you need to create a directory from Air and you dont know how, mostlikely you will use the Adobe Air Documentation and use something as the following:
- var directory = air.File.documentsDirectory;
- directory = directory.resolvePath("AIR Test");
- air.File.createDirectory(directory);
- air.trace(directory.exists); // true
it all looks nice and makes sense but in the real world it wont work, you would get an error like this:
Type Error : Value undefined ( result of expression air.File.createDirectory ) is not object.
# of your code error.
The problem with this approach is that the createDirectory method doesnt take any parameters, if you try to pass values directly to the method you will get this error:
Argument Error : Error #1063: Argument count mismatch on flash.filesystem::File/createDirectory(). Expected 0, got 1.
Once i was able to get this error I realized that the docs were wrong, or at least on this specific section. So looking at a different sample I figured out this works:
[js]
var directory = air.File.documentsDirectory;
directory = directory.resolvePath("Air Test");
directory.createDirectory();//no parameters necessary, Air knows where we need the new directory.
[/js/]
By first "asking" Air if the directory exists then Air knows where to create the new Directory rather than passing the property directly to the method.
This applies to Adobe Air SDK 3.0 and using Javascript
Tags: Air, Adobe, Javascript, SDK
//Adobe Removing restrictions on use of the SWF and FLV/F4V format via the Open Screen Project.
Posted by Helmut | Filed under News
The Open Screen Project is working to enable a consistent runtime environment – taking advantage of Adobe® Flash® Player and, in the future, Adobe AIR™ -- that will remove barriers for developers and designers as they publish content and applications across desktops and consumer devices, including phones, mobile internet devices (MIDs), and set top boxes.
Tags: OpenSource, Flash, FLV, F4V
//Adobe Air Textmate Bbundle
Posted by Helmut | Filed under AS Burst
I started creating an Adobe Air application with Adobe DreamWeaver and it works great, but I am so used to doing development with TextMate that I ended up using DreamWeaver just for previewing and compiling the application and TextMate for development. Fortunatelly for us Matthew Reed has created a Bundle to test and compile your Adobe Air Applications in just 3 steps:
- Download Source in Matthew Reed's site
- Install Into Textmate
- Use it! Control + Return
Thanks for this bundle!
Source: Adobe Air™ TextMate Bundle
Note: He recommends to install (or have) the SDK inside "Applications/AdobeAir" and the bundle works as expected. But if you would like to change the location where the Bundle makes reference to you can do so by looking under:
Bundles>Bundle Editor>Show Bundle Editor
Tab to:
Air> Package Preview
Air> Package Self-signed
and you will find the following lines:
export PATH=$PATH:/Applications/AdobeAir/bin
export CLASSPATH=/Applications/AdobeAir/lib/adt.jar
adl "$TM_PROJECT_DIRECTORY/application.xml"
Change /Applications/AdobeAir/ to the location of your SDK.
//Video: Microsoft chairman offers Yahoo rationale - CNET News.com
Posted by Helmut | Filed under News
Bill Gates offers some insight on their rationale behind trying to acquire Yahoo... and everyone is talking about that. What i found more interesting is their approach to provide their software for free to students. Now that is a move that I believe it is going to help them greatly. If you are a student you might not be able to afford $400+ USD software, even some professionals have a hard time gathering the cash to buy the software. Some packages cost as much as $2,000+ USD. So providing Microsoft products for free to students -I believe- it is the right move because those same kids that will spend hours using the software right now, tomorrow will shape the stability of what software is being used at that moment.
In an interview with CNET News.com's Ina Fried, Microsoft's chairman explains why the company is giving away its developer tools to students and offers a glimpse at the rationale behind the Yahoo bid.
Source
Tags: Microsoft, Software, Free
//Flash CS4 - What’s Next
Posted by Helmut | Filed under AS Burst
New stage rendering core in Flash 10
* Live video playing in author time (meaning you don't have to compile your movie to see how your video will be displayed)
* New timeline, similar to After Effects (or Director as some people have pointed this out)
* No more keyframes
* Transfer objects between Tweens.
* Bones
* Runtime Inverse Kinematics
* And more....
Disclaimer: Not all features listed in demos actually make it to the final release
//WebkitErrorDomain error 203
Posted by Helmut | Filed under AS Burst
This error is produced in Safari for MAC and you can't view it unless you are looking at the Activity window AND you are trying to load the same file at the same time.
For example note the following:
- loadFile1();
- loadFile1();
- function loadFile1() {
- load("file1.swf")
- }
I know this is too ovious to go un noticed, but if you have a large project you are working on there might be the possibility that you might be trying to load the same file twice and thus Safari tries to load the file twice and the error is produced.
This is what "i think" its going through Safari's little mind.
Load file1.swf
...loading
Load file1.swf
...loading .... Wait?! its the same file
STOP loading the file and trow and error!
Throw Error WebkitErrorDomain error 203
Load file1.swf
The benefit of always cleaning after yourself (AS Analogy)
Posted by Helmut | Filed under AS Burst
When we were kids we had the pleasure of having mom, dad or an older sibling cleaning after ourselves. So if we left any dirty clothes on the floor or any dirty dishes on the table after eating any older mature adult would come up and clean up the mess.
As we grew old hopefully we were thought to clean after ourselves and also we were thought the benefits of doing so. Such as having a nice clean apartment to show off to your friends, or being able to find a wife because girls like to come to your place since it is always clean rather than knowing that if they visit you they wont know where to sit wether on top of pizza boxes or your dirty laundry on the couch. And some other benefits that your parents through rationale or fear put in your head and you have in there until today.
Now you entered the world of Actionscript programming either by choice of by accident, if you entered this magnificent world of Actionscript by choice and your teachers thought you well you were probably thought to clean after yourself just as you did at home, now if you arrived to Actionscript programming by accident you might have not known the benefits of doing a little bit of clean up after you were done working with certain items (properties). Specially if the project you are working on is small.
Not only that but if you have been working with AS1 (Actionscript 1) or AS2 (Actionscript 2) you would have flash doing all the cleaning for you. Take a look at the following example in AS2
- // AS2
- var myShirt = this.attachMovie ("Shirt", "myShirt", this.getNextHighestDepth() );
- myShirt._x = 100 ;
- trace(myShirt._x); // 100
- myShirt.removeMovieClip();
- trace(myShirt._x); // undefined
- var myShirt = this.attachMovie ("Shirt", "myShirt", this.getNextHighestDepth() );
- trace(myShirt._x); // 0
What a beauty! if I remove my object from the stage the _x property of the object returns as expected "undefined". So by now we have once again being spoiled by our wonderful programming parent Actionscript. Who does the cleaning for us after removing an item from the stage. Now eventually Actionscript grew up and became more like an adult that wants you to be responsible for your items and not having to clean up after yourself all the time. This is not only good but it helps you to keep track of what you are doing and how to handle different items.
Going back to the home-parent analogy we can think of this as when we were kids we didn't know neither cared of how our shirts and pants were cleaned. All we knew is that we were able to walk in our closet and find a new clean shirt or pants if we needed. Now with Actionscript you were able to do the same in AS1 and AS2. if you used an object and deleted it from the stage it would magically get washed, ironed and back into our closed for a later use.
Now lets see what happens with AS3, so lets try a very similar sample as the one above:
- // AS3
- var myShirt : Sprite ;
- myShirt = new Shirt;
- myShirt.x = 100 ;
- addChild(myShirt);
- trace(myShirt.x ); // 100
- removeChild(myShirt);
- trace(myShirt.x); // 100
So when I remove an item from the stage (Display List), the it stays in memory and Flash still knows its there, as you can tell on our second trace statement we were able to get the "x" property from our object even though we removed it with removeChild. So how do we "clean" after ourselves in AS3? Well we tell flash that we wont use the objects anymore by setting them to null or undefined, it just depends of what kind of object or property you are working with.
So to fix our issue we do the following:
- var myShirt : Sprite ;
- myShirt = new Shirt;
- myShirt.x = 100 ;
- addChild(myShirt);
- trace(myShirt.x ); // 100
- removeChild(myShirt);
- trace(myShirt.x); // 100
- myShirt = null ;
- trace(myShirt.x); // see below
- // we would get a beautiful error as follows in the third trace:
- //TypeError: Error #1009: Cannot access a property or method of a null object reference.
- // at ___fla::MainTimeline/frame1()
Success we were able to remove the object from the stage and also cleaned up after yourself. You might be thinking, how lame! I dont need to keep track of my objects since there are only 3 of them. That is fine but when you are writing an application and you have 1000 objects or better yet you add Sprites, MovieClips, Sound and Video to your application (or swf movie ) then you would be glad you learned early in the game to clean up. Remember AS3 is maturing and is not going away so this is the new standard and you must adapt to what daddy Flash is telling you to do ( or is it mommy Flash? )
Disclaimer: I have been meaning to post something about "cleaning up after yourself" for quite a while and finally decided to push this analogy live. But by no means is the perfect analogy and specially for those programmers with 100 years of experience but it is mainly to explain the basics of adding and deleting objects from the stage for those who have difficulty understanding the concept.