May 1

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:

JavaScript:
  1. var directory = air.File.documentsDirectory;
  2. directory = directory.resolvePath("AIR Test");
  3.  
  4. air.File.createDirectory(directory);
  5. 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: , , ,

Sep 21

[kml_flashembed movie="/labs/swf/reveal.swf" height="150" width="450" /]

I was talking the other day with a friend about a small challenge, having 2 images on stage with 2 ideas. 1- have the experience being user driven (in this case the mouse reveals one image while hiding the other) 2- Use XML for easy update. So we fired flash and the above is the visual and the code below... Read the rest of this entry »

Mar 29

Title: Dynamic Sliders Numero 2

After working with the previous version of the sliders -se previous post-. I had the opportunity to "upgrade" the sliders since there was a slight chance that the sliders had to react to only one button rather than two as originally planned. Needless to say it wasn't required to apply this update but it came out nice. Once again there was no need to update anything in the class but just 2 extra lines of code.

[kml_flashembed movie="/labs/swf/slider2.swf" height="250" width="300" /]

Mar 27
Dynamic Sliders
icon1 helmut | icon2 Tutorials | icon4 03 27th, 2007| icon3No Comments »

So I was working on a project where we needed some sliders, it was basically the same slider but in different sizes and positions. So today I was sitting there just wondering how I could make this more dynamic, and just put a small class together and created a small sample. Updating the sliders the way they were originally created took a long time but allowing the sliders take the parameters dynamically it took seconds to update.

Here is the sample and feel free to play with it :)

[kml_flashembed movie="/labs/swf/slider.swf" height="250" width="300" /]

Nov 10

So I was running in to the following problem:

**Warning** The linkage identifier 'RewindBtn' was already assigned to the symbol 'FLVPlayer_assets/Buttons/Rewind', and cannot be assigned to the symbol 'FLVPlayer_assets/Buttons/Rewind', since linkage identifiers must be unique.

But in reallity I only had 1 button called Rewind with the Link ID of RewindBtn and nothing else. I even created a blank FLA and pasted the simbol by itself in the blank FLA but I still were getting the same warning.

Well after doing a search online and trinkering with flash I figured out that originally I had created the Symbol as button and then transformed the Button to a MovieClip within the Library but never changed the  Button to a MovieClip within the Properties panel in Flash.

Go figure! the warning has gone away.

Oct 11

If you are a developer and you do some sort of backend work there is a chance one of your clients might ask you to install an application in GoDaddy servers.

So if you are trying to connect to a dabase within your application what GoDaddy recommends is to use mysql.secureserver.net as your hostname. Maybe this could have worked while back but that information is not true for all servers.

If you are having problems all you have to do is login to your GoDaddy control panel and look what server has GoDaddy assigned for you, at least that is how it worked out for me.

Jul 27

Tutorial details:
Written by: Helmut Granda , MX

Time:
15 minutes
Difficulty Level:
Intermediate

Requirements:
Flash MX, READ THIS TREAD
Topics Covered:
How to avoid writing code inside
every single MovieClip and load dynamic content.

Assumed knowledge:
Variables, Functions, MovieClips,
Buttons

In our previews tutorial
we learned how we can place our code in one place and assign actions
to severan Movie Clips at once rather than one by one.

and here it is the code to do that:

Read the rest of this entry »

Jul 26

Tutorial details:
Written by: Helmut Granda , Flash MX

Time:
15 minutes

Difficulty Level:
Intermediate

Requirements:
Flash MX

Topics Covered:
How to avoid writing code inside every single MovieClip.

Assumed knowledge:
Variables, Functions, MovieClips,
Buttons

S J Mangold Asked at flashnewbie mailing list the following question:

I could use some help with the next step in my programming education.

I have a set of buttons that typically are enabled/disabled at the same
time. Currently, I write code for each button. There's got to be a way that
I can handle this more simply but don't have a clue as to what it would be.

Any help would be greatly appreciated.

Thanks!

Sue

There are many ways of solving this problem, you can do it with a function, using the call command or creating a prototype.

We will cover the prototype solution.

Read the rest of this entry »