thePlayer.source = “Domain_video.flv”;

for (int i=0; i<5; ++i)
{

    cout << "smap!" << endl;
}

import flash.events.EventDispatcher; import fl.video.*; thePlayer.source = "splash.flv"; This is the part that is kinda funky var theCuePoint:Object = new Object(); theCuePoint.time = 0.001; theCuePoint.name = "main_video"; thePlayer.addASCuePoint(theCuePoint); function splashCuePoint(evt:MetadataEvent):void { loadVideo(); } thePlayer.addEventListener(MetadataEvent.CUE_POINT, splashCuePoint); function buttonClick(evt:MouseEvent):void { loadVideo(); } theButton.addEventListener(MouseEvent.CLICK, buttonClick); function loadVideo():void { thePlayer.source = “main_video.flv”; thePlayer.play(); theButton.enabled = false; theButton.visible = false; } This is the text.

[ftf w=”400″ h=”400″ def=”as2.xml” auto=”true”]import flash.events.EventDispatcher;
import fl.video.*;

/*thePlayer.source = “splash.flv”;*/

var theCuePoint:Object = new Object();
theCuePoint.time = 0.001;
theCuePoint.name = “main_video”;
thePlayer.addASCuePoint(theCuePoint);

function splashCuePoint(evt:MetadataEvent):void {
loadVideo();
}

thePlayer.addEventListener(MetadataEvent.CUE_POINT, splashCuePoint);

function buttonClick(evt:MouseEvent):void {
loadVideo();
}

theButton.addEventListener(MouseEvent.CLICK, buttonClick);

function loadVideo():void {
thePlayer.source = “main_video.flv”;
thePlayer.play();
theButton.enabled = false;
theButton.visible = false;
}[/ftf]

Flash CS3 / Flex AS3 Error #1086

ActionScript Error: 1086: Syntax error: expecting semicolon before mult

Description:
This is a very easy and straightforward error with a horrible description. It actually has nothing to do with a semicolon at all. All this error means is that you forgot a ‘.’ in your import before the ‘*’.

Fix:
Add the Dot

Bad Code:

import flash.events*;

Good Code:

import flash.events.*;

Hopefully the confusing description for this ActionScript Error didn’t cause you to pull your hair out.

As Always Happy Flashing

Flash Error #1086: Syntax error: expecting semicolon before dot.

Description:
Another reason for the Flex / Flash Error #1086 is because a function/method call is typed.  It is very important to type a function but do not type the call to the function.

Fix:
Remove the typing at the end of the method call.

Bad Code:

resource.readXml (requestId, onResourceXmlLoadSuccess, onResourceXmlLoadFail):void;

Good Code:

   resource.readXml (requestId, onResourceXmlLoadSuccess, onResourceXmlLoadFail);

Happy Flashing

Flash CS3 / Flex AS3 Error #1053

ActionScript Error #1053: Accessor types must match.

Description:
This is a great error that has absolutely no documentation. This is what Adobe has to say about it.

The non-error error.  ActionScript Error #1053 from Adobe Live Docs
Notice how the right side of the image doesn’t have any text at all. It is simply left blank. To understand this error you need to understand what an ‘Accessor’ is. An ‘Accessor’ is a ‘Getter’ that accompanies a ‘Setter’. The reason it is called an ‘Accessor’ is because it accesses the variable set using a ‘Setter’.

So what does that mean for you. This error means that the Getter(Accessor) is not set as the same Type as the Setter.

Fix:
Make sure that whatever you return in the ‘Getter’ is the same ‘Type’ as what is set in the ‘Setter’.

Bad Code:

function get sClickable():String {
return _clickable.toString();
}
function set sClickable(myClickable:Boolean):void {
this._clickable=myClickable;
}

Good Code:

public function get sClickable():Boolean {
return _clickable;
}
public function set sClickable(myClickable:Boolean):void {
this._clickable=myClickable;
}

So now you know how to solve ActionScript Error #1053.

As Always Happy Flashing.

Flash/Flex AS3 Error #1023: Stack overflow occurred.

Error #1023: Stack overflow occurred

at MyClass/get id()

Description:
This will happen if the stack has so much data that it is full. Nothing like Thanksgiving dinner to overflow my stack.  What is a stack and how does it get full you ask. Simply put each method(function) has a stack and that stack stores data associated with the method such as local variables with the method. Although it is a good idea to understand what a stack is you really you don’t need to have an in depth understanding of stacks to understand this error and it’s solution. Basically this error is saying that you are most likely calling the function recursively. Or in other words you might be calling the function from within itself.

Solution:
To rid yourself of ActionScipt error 1023 make sure that you don’t call the method from within itself which will eliminate any type of recursion in your method call. You may be tempted to do this by setting a variable name the same as the function name. Change either one and this will go away. Notice in the ‘Bad Code1’ example that each time the getter returns what you think is an ‘int’ you actually are calling the setter function again recursively. The trace statement will also produce AS3 Error #1023

Bad Code1:

public function set id (myId:int):void
{
this._id = id;
}
public function get id ():int
{
trace(“this.id”,this.id);
return this.id;
}

Good Code1:

public function get id ():int
{
trace(“this.myId”,this.myId);
return this.myId;
}

Bad Code2:

private function recursiveLoop ():void
{
recursiveLoop ();
}

Good Code2:

private function noRecursion():void
{
someOtheFunction ();
}

Adobe actually has a reasonable explanation for this error in liveDocs. Here is a link to the Adobe page that explains ActionScript Error 1023

As always Happy Flashing

Flash CS6 / Flex Error #1009: Cannot access a property or method of a null object reference

TypeError: Error #1009: Cannot access a property or method of a null object reference

ActionScript 3 Error #1009 is an AS3 that you can get for many anecdotal reasons. This error basically means that you are trying to reference something that isn’t there yet. That something can be a variable, data from the server, or even a movieClip or other display instance. So if you try and make a call to something and are getting this error simply look at what you are trying to reference and ask yourself is it there yet.
Don’t bang your head against the wall any longer. Here I explain one of the most un-obvious ways to get this error.

One reason that you will get AS3 Error #1009 is because you are trying to access a movieClip that isn’t instantiated yet. For example you try and reference a movieClip named loader_mc that is inside another movieClip. you are referencing it from a class that you created. Each time you run the test the movie you get the Run-Time Error #1009. You look inside your movieClip and see that the loader_mc is right where you want it. It is on frame 10 inside your animated moveiClip. That is when it dawns on you that the call to loader_mc happens when it is instantiated. Simply, put loader_mc on frame 1 and change it’s alpha to 0 and then the movieClip will be instantiated when the call from your custom class is made.

Another reason for this error is simply incorrect targeting. If you target parent.bob and the correct reference is parent.parent.bob then you will get this error as well.

Fix 1 :

Make sure the the reference is instantiated before it is called.  This means that the script is run after the object is loaded or the frame in the animation has been reached etc…

Fix 2 :

Check your targeting

Thanks and Happy Flashing

Flash CS3 / Flex Error #2136: The SWF file file:///C|/Curtism/Flash/matchWordsGameTest.swf contains invalid data

#2136: The SWF file file:///C|/Curtism/Flash/myFile.swf contains invalid data.

Fun error that you get when compiling the swf with an external AS file as your ‘Document class’. Most Likely you will get this error if you are using a document class and also have code on your timeline.

Fix :

Remove the code from your timeline or remove the Document Class

As Always Happy Flashing

Flash/Flex AS3 Error #2007

Error #2007: Parameter text must be non-null.It is the error of the year Error 2007. This error is very ambiguous but is not hard to understand once you realize what it means.

This error means that you are trying to assign an object some text but you forget to target the text and instead you target the text field. In the bad example below ‘.text’ is forgotten. It is included in the Good Code

Bad Code:

for (var i:int = 0; i<15; i++) { array[i] = myText_txt;
}

Good Code:

for (var i:int = 0; i<15; i++) { array[i] = myText_txt.text;
}

And that is how you solve ActionScript Error #2007: Parameter text must be non-null.

As always Happy Flashing

Nike+ 100 Mile Club

I am very excited to share with you that I have made the 100 mile club on Nike+.

Here is the proof Nike+ 100 Mile Club

Nike+ iPod is an amazing system. If you are contemplating it, you should stop thinking about it and go right now and get one. In high school I did sprints and short distance on the track team. I tried out for the cross country team and promptly quit after 2-3 weeks. I loved to sprint in the 100, 200, and would even do the 400. I was on relay teams and my best event was the long jump. I tell you this to let you know how much I was not a long distance runner. I actually expressed my disinterest in running many times over the years. If you were to tell me that I would run a hundred miles in a few months I would have thought you were crazy. That is until I got the Nike+ system. Now I run and run and just keep going. Nike+ is probably the biggest reason that I have turned into a runner. The system is amazingly easy to use and eliminates all the work that you have to do. Instead of getting out the spreadsheets and tracking progress, I now just sync my iPod nano and it uploads all my workouts, charts them, applies them to the goals I have set and challenges that I have joined and shows me progress, calories, distance, time, pace, etc, etc…

The last two big plugs for Nike+ is that the website is killer and the community that the website is built around is amazingly supportive. I never considered myself a runner like my neighbor or friends, but now I am actually starting to think that maybe I am one. Thanks Nike+ iPod and thanks to the community that support me.

Happy Running