Flash Forward – Boston 2007

Flash Forward – Boston 2007
This is my third Flash Forward Event.  The first was the original 2001 Flash Forward on Nob hill in the Masonic Temple where Adobe and Macromedia both gave away full software bundles.  At the time the two companies were separate and not so friendly with each other.  I will never forget the Macromedia reps trading Adobe Bundles for another copy of the Macromedia Bundle and then throwing the software to the ground and stomping on it.  Adobe saw what was going on and decided they would do the same.  I ended up walking away with three full versions of the Macromedia Suite.  I think it was Dreamweaver 3 and the rest of the bundle.  Sinbad was still funny at the time and made jokes about how stinky developers where.  And Josh ______ from praystation was a rock star.

The second event was 2006.  musicRAIN was a finalist in the FlashForward film festival.  Lynda and Stewart decided that they would part ways.  Josh Buhler and I went to lunch with Danny Dura and Christian Cantrell.  And Flash was coming of age.

And now Flash and Flex are not only accepted but respected as the platform for developing Rich Internet Applications.  What was once only a dream is now a standard practice.  The tables have turned and instead of HTML just embedding Flash within itself Flash is the container for HTML.  The gap is being bridged between the desktop app and the website.  This is probably the most important Flash Forward that I have attended because of what I am working on currently.  I hope to gain a lot form this conference and be able to use it to further the progress of the amazing application that we are currently building.

Please email me and let me know you are at Flash Forward Boston also and please say Hi.  I would love to go to lunch and hear what you are working on and how Flash/Flex has made a difference in your world.

Over the next three days I will be giving a summary of my experience at Flash Forward Boston 2007

Posted in Uncategorized

Flex / Flash CS3 Error #3553

Warning: 3553: Function value used where type void was expected. Possibly the parentheses () are missing after this function reference.

Description:
This is one of the best descriptions that I have seen for a Flash Error. This Flex/Flash Error is actually just a Flex/ Flash Warning. This error/warning means exactly what it says. You just forgot the parentheses () when you tried to make a method call.

Fix:
Add the Parenthesis

Bad Code:

var myTime:Timer = new Timer(1000, 3);
myTime.start;

or

var myDate:Date = new Date();
myDate.getDate;

Good Code:

var myTime:Timer = new Timer(1000, 3);
myTime.start();

or

var myDate:Date = new Date();
myDate.getDate();

As always Happy Flashing

I Remember

I remember thinking how fast the elevator was up to the observation deck.
I remember examining the chess board that sat in solitariness awaiting the next moves from Kasparov and Big Blue.
I remember standing on the top floor of the slender giant and feeling the gentle careening of the building as the wind blew so high above the city.I remember the call that said turn on the T.V.
I remember the disbelief at seeing the plume of smoke from the building I had once ascended.
I remember the papers and debris.
I remember calling everyone I knew and telling them to turn on their televisions.
I remember how time slowed to a still as the second plane was spotted in the air.
I remember the moment of impact.
I remember the ball of flames a city block wide.
I remember thinking about my friends in NYC.
I remember naming them each individually and wondering where they were at that very moment.
I remember the horror that gripped me as some chose their death rather than be subjected to it.
I remember the collapse of 2 WTC.
I remember how 9 seconds of the collapse played through my mind so slowly every detail was etched into my memory.
I remember the collapse of 1 WTC.
I remember the void that was left after the plume of smoke blew to the side.
I remember the confusion on my twin boys faces as the twin towers fell.
I remember the disbelief I felt in my soul and saw on my wifes face.
I remember counting the numbers that could be trapped beneath the rubble.
I remember the grief I bore.
I remember seeing the ghosts of heroes walking and running out of the dust.
I remember how the tears felt on my cheek.
I remember the pentagon.
I remember the prayers I offered for those grieving. for children who’s worlds had been shattered.
I remember the prayers for the firemen, the policemen, the soldiers.

I remember the sadness of knowing that no one would be able to look over the city from there again.

I remember the brotherhood of New Yorkers.
I remember the forgiveness of Americans
I remember the renewal of patriotism.
I remember the unity of this nation.
I remember the resolve of a free people.
I remember the presidents words “Terrorism against our nation will not stand”.
I remember what we are fighting for.
.

.

I still remember

.

.

I still pray

.

.

.

.

http://www.usa-patriotism.com/fv/911wwr2.htm (Patriotic Video)

http://www.youtube.com/watch?v=nptA5uj6ZRY&v3 (Please Remember Me)

http://www.youtube.com/watch?v=ervaMPt4Ha0 (15 yr old Lizzie Palmer’s Video)

Flash CS3 / Flex 2 AS3 Error #1116

ActionScript Error #1116: A user-defined namespace attribute can only be used at the top level of a class definition.

Description:
This ActionScript error will pop-up when a namespace is declared anywhere besides the class definition. What is a class definition you ask? It is simply the code that says names the class – something like ‘public class MyClass’

After the class is defined you are allowed to create custom(or ‘user-defined’) namespace on that level. Anywhere else in the code is not legal. This ActionScript Error is closely related to the Flash/Flex error #1114.
This AS3 error may also just be a typo. you may have typed something like ‘publi class’ rather than ‘public class’ or ‘prvate function’ rather than ‘private function’

Fix:
Either fix the misspelling in your code or place the ‘user-defined namespace’ inside the class definition. The second code example shows a namespace to separate cars and animals. Notice how the bad example nested the ‘user-defined namespace’ inside the constructor function.

Bad Code 1:

package com.cjm.somepackage
{
publi
class MyClass {
publi
function MyClass() {}
}
}

Good Code 1:

package com.cjm.somepackage
{
public
class MyClass {
public
function MyClass() {}
}
}

Bad Code 2:

package
{
public class MyClass
{
public namespace Cars;
public namespace Animals;public function MyClass() {
Animals var Jaguar:String = “A large cat chiefly of South America”;
Cars var jaguar:String = “A large car chiefly driven in North America”;
}

Cars function run():void {
trace(“At $30/mile”);
}

Animals function run():void {
trace(“On four legs”);
}
}
}

Good Code 2:

package
{
public class MyClass
{
public namespace Cars;
public namespace Animals;

Animals var Jaguar:String = “A large cat chiefly of South America”;
Cars var jaguar:String = “A large car chiefly driven in North America”;public function MyClass() {
}

Cars function run():void {
trace(“At $30/mile”);
}

Animals function run():void {
trace(“On four legs”);
}
}
}

Adobe has a great explanation of how to use namespaces as well as Collin Moock in Essential ActionScript 3 in Chapter 17

As always Happy Flashing

Flash / Flex Tutorial – How to Create a crossdomain.xml file.

Flash / Flex Tutorial – How to Create a crossdomain.xml file.

This brief tutorial will teach you how to create a crossdomain.xml file so that you can access files and information from outside domains and load files and data within your Flash / Flex apps. It is as simple as 4 easy steps.

  1. Create an xml file named crossdomain.xml. (XML can be created with Dreamweaver or just simply MS Notepad. Just make sure that you give it the ‘.xml ‘ extension on the end.)
  2. Copy and paste one of the code examples below into the XML file:
  3. Save the file.
  4. FTP / upload the file to the root directory of your website. (you should be able to see the file in a browser by typing the url www.yourwebsite.com/crossdomain.xml).

XML Code 1:
This is a typical crossdomain.xml file. Notice that I included my domain as well as my domain without the ‘www’ in front.

<?xml version=”1.0″?><!DOCTYPE cross-domain-policySYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”>
<cross-domain-policy>
<allow-access-from domain=”www.curtismorley.com” />
<allow-access-from domain=”curtismorley.com” />
</cross-domain-policy>

XML Code 2:
The follwing Code will allow all domains. This effectively eliminates any security that Flash would have otherwise had. I suggest that you don’t use this example unless you enjoy security holes.

<?xml version=”1.0″?>
<!DOCTYPE cross-domain-policy SYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”>
<cross-domain-policy>
<allow-access-from domain=”*” />
</cross-domain-policy>

XML Code 3:
The block of code below will explicitly disallow any and all access from any outside domain. As well, any domain that is not spelled exactly how the host domain is spelled will be blocked. This is the tighest cross domain security that you can employee.

<?xml version=”1.0″?>
<!DOCTYPE cross-domain-policy SYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”>
<cross-domain-policy>
</cross-domain-policy>

XML Code 4:
The code below illustrates different uses of the ‘*’ wildcard symbol. This is the crossdomain.xml file from Amazon.com The wildcard allows for any variation before ‘.amazon.com’. Amazon does this because of the public services and APIs that it allows others to connect to.

<cross-domain-policy>
<allow-access-from domain=”*.amazon.com”/>
<allow-access-from domain=”amazon.com”/>
<allow-access-from domain=”www.amazon.com”/>
<allow-access-from domain=”pre-prod.amazon.com”/>
<allow-access-from domain=”devo.amazon.com”/>
<allow-access-from domain=”images.amazon.com”/>
<allow-access-from domain=”anon.amazon.speedera.net”/>
<allow-access-from domain=”*.amazon.ca”/>
<allow-access-from domain=”*.amazon.de”/>
<allow-access-from domain=”*.amazon.fr”/>
<allow-access-from domain=”*.amazon.jp”/>
<allow-access-from domain=”*.amazon.co.jp”/>
<allow-access-from domain=”*.amazon.uk”/>
<allow-access-from domain=”*.amazon.co.uk”/>
</cross-domain-policy>

Creating a cross domain policy file is just that easy.

And Happy Flashing.

P.S. I highly suggest that you read one or all of the following articles on cross domain policy files and the Flash Player security sandbox,

Crossdomain Article by Colin Moock

Adobe Crossdomain Technote (this one is required reading)

Flash Player 9 Security Whitepaper

Adobe LiveDocs on Flash Player Security

Flash CS3 / Flex 2 AS3 Error #2148

ActionScript Error #2148:
SecurityError: Error #2148: SWF file file:///C:/Documents and Settings/UserProfile/Desktop/flexstore/bin-release/flexstore.swf cannot access local resource myFile.swf. Only local-with-filesystem and trusted local SWF files may access local resources.

Description:
ActionScript Error #2148 can be caused by a number of reasons. If you are using Flex please keep in mind that the bin directory is a special directory that the Flash player allows SWFs ( and other files ) to load from as long as the file is stored in this directory. It will also allow a loaded swf to access network resources (a remote HTTPService call for example). If these files are placed anywhere besides the bin directory, the Flash Player prevents the file from accessing any external resources. You can allow for external access by changing the settings within the FlashPlayer or within Flex. These solutions are listed below

Fix 1 :
If you’re loading in XML or other files from a remote sever that isn’t hosting the SWF too, make sure you create a crossdomain.xml policy, and put it on the root of your webserver. If you haven’t heard about a cross domain policy or need help creating a crossdomain.xml file click the link and I will show you how to create a crossdomain.xml file. View my tutorial on How to Create a crossdomain.xml file and visit the links on the bottom of the page to learn more.

XML Code:

<?xml version=”1.0″?>
<!DOCTYPE cross-domain-policySYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”>
<cross-domain-policy>
<allow-access-from domain=”www.curtismorley.com” />
<allow-access-from domain=”curtismorley.com” />
</cross-domain-policy>

Fix 2:
Within ActionScript you are now able to specify the cross domain access from within the code. I won’t get into the guts of this one but if you want to learn more view the Flash / Flex documentation or Adobe LiveDocs – Security Chapter or get Joey Lott’s book ActionScript 3 Cookbook By adding this code you will get rid of ActionScript Error #2148 If you are using https:// you will need to use allowInsecureDomain() as shown below. If you are using a local file make sure to target it correctly(i.e. c:\myFolder).

ActionScript Code:

flash.system.Security.allowDomain(“http://www.curtismorley.com”);flash.system.Security.allowInsecureDomain(“http://www.curtismorley.com”);

Fix 3:
One hack to get rid of ActionScript Error 2148 is to add these arguments to the compiler (via Properties – Flex Compiler) : -use-network=false . Beware though this will effectively change your cross-domain security.

Good Code:

-use-network=false

Fix 4:
Make sure your Global Security Settings in Flash Player allows local access to the directory your SWF/XML is running from. At the Global Security Settings in Flash Player click on Edit locations >> Add location and then either type in the new location your SWF is at (i.e. c:\myFolder) or browse for the file or folder. Shut down Flash/ Flex and all instances of the Flash Player(including browsers), and then try again. This will eliminate this ActionScript Error #2148. This solution only works for you on your computer. If you cahnge computers or change locations on the web please refer back to Fix 1.

And now you know 2 ways to fix and 2 ways to circumvent ActionScript Error #2418: Security Error

Happy Flashing

Flash CS3 / Flex 2 AS3 Error #5000

ActionScript Error #5000: The class ‘com.cjm.MyObj’ must subclass ‘flash.display.MovieClip’ since it is linked to a library symbol of that type.

Description:
This little error will pop up when you have used the linkage in your library and have not targeted the Class properly.

Fix:
Make sure that in your custom ActionScript Class that you have imported the MovieClip Class properly.

Bad Example:

package com.cjm{
public class MyObj extends MovieClip {

Good Example:

package com.cjm
{
import flash.display.MovieClip
public class MyObj extends MovieClip {

So import those classes properly to fix ActionScript Error #5000 and Happy Flashing

Flash CS3 / Flex 2 AS3 Error #1026

ActionScript Error #1026: Constructor functions must be instance methods.

Description:
You will get Flash / Flex Error 1026 if you have assigned the constructor of a class to be static. What you most likely wanted to do was create a static method within your class that can be called directly from the class itself rather than from an instance of the class. You are probably trying to create something like the Math.round() method within the Math class. This is a static method and can be called directly from the class.

Fix:
Remove the keyword ‘static’ from the constructor function within your class.

Bad Code:

public class MyStaticMethod
{
public static function MyStaticMethod()
{
public static function theRealStaticMethod (inputString):int

Good Code:

public class MyStaticMethod
{
public function MyStaticMethod()
{
public static function theRealStaticMethod (inputString):int

I hope that you didn’t bang your head against the wall with AS3 Error 1026. It is an simple ActionScript Error to fix with a strange description.

Happy Flashing

Flash CS3 / Flex 2 AS3 Error #1172

ActionScript Error: #1172

Description:
This error is encountered when Flash/Flex cannot find your Class.

Fix:
Make sure that the targeting is correct.

Bad Code:

import com.cjm.everseString;

or

import com.cjm.reverseString;

Good Code:

import com.cjm.ReverseString;

So now you know how to fix AS3 Error 1172

Happy Flashing

Flash CS3 / Flex 2 AS3 Error #1093

ActionScript Error #1093: Syntax error.

Update 2/25/2008

Description:
This is one of the least descriptive descriptions that Flash/Flex will provide you. It can be given for a number of reasons. Some that I have run into I have not found the reason for, but instead I just rewrite the entire line of code that it reports. One reason that I have found that is duplicate-able is copying code from the web and pasting it into Flash. Most especially code with quotes.

Fix 1:
Delete the line of rogue line of code and retype it from scratch.

Again I had this error and even after commenting the line of code out entirely I still received this error. Once more I deleted the code and retyped and it worked just fine. Below is the line of code commented out. Don’t beat your head on this one. Just delete and retype. I believe that this error has something to do with the copy and paste functionality within the IDE.

Bad/Good Code 1: (this code actually works after being retyped)

/*//stage.removeEventListener(Event.ENTER_FRAME, moveCar);*/

Fix 2:
Delete the quotes from the code that you copied from the web and replace them with regular quotes.

Bad Code 2:

this.thePlayer.videoSource = main_video.flv;

Good code 2:

this.thePlayer.videoSource = main_video.flv;

Fix 3:
Delete the #(pound symbol) before the color value.

Bad Code 3:

graphics.lineStyle(1, #FFFFFF);

Good code 3:

graphics.lineStyle(1, 0xFFFFFF);

Thanks to grildcheese who left a comment about Fix3 above.

Fix 4:
Do not use #include in ActionScript 3 instead use import.

Bad Code 4:

package
{
#include “myClass.as”

Bad Code 4:

package
{
import myClass;

I will continue to post reasons for AS3 error 1093 as I find them and hopefully it will help you out.

As Always, Happy Flashing