09.03.08
Posted in Adobe, Flash, quicktip at 6:32 am by Curtis J. Morley
Are you looking to speed up your coding in AS3 when you are working in Flash environment? Here is a list of hotkeys that you can use in your actions Panel or with external .as files. Just hit the [Esc] key and then individually hit the two keys listed after and Flash will spit out a snippet of code for you.
If you want to add your own Flash Quickeys go into the ActionsPanel.xml file and add a quickey. For example if I wanted to create a pacakage that contained a class and a constructor then I could create my own quickey to do all of that. or if I just wanted to create a package then I would add id ="package" quickey="pk" to the line that starts <string name="package" in a similar fashion as the rest of the line with quickeys.
Flash ActionScript3 HotKeys
| AS3 output |
Quickey |
| |
|
| trace ( ); |
[Esc - tr] |
| break( ); |
[Esc - br] |
| case condition : |
[Esc - ce] |
| continue; |
[Esc -co] |
| default : |
[Esc -dt] |
| do { } while ( ); |
[Esc-do] |
| } else { |
[Esc -el] |
| for ( ) { } |
[Esc -fr] |
| for ( ) { } |
[Esc -fi] |
| if ( ) { } |
[Esc -if] |
| return ( ); |
[Esc -rt] |
| switch ( ) { } |
[Esc -sw] |
| throw ; |
[Esc -th] |
| try { } |
[Esc - ty] |
| catch ( ) |
[Esc -ch] |
| finally { } |
[Esc -fy] |
| " " |
[Esc -ev] |
| while ( ) { } |
[Esc -wh] |
| with ( ) { } |
[Esc -wt] |
| class { } |
[Esc -cl] |
| function ( ) { } |
[Esc -fn] |
| var ; |
[Esc -vr] |
| // |
[Esc -//] |
As always happy Flashing
Curtis J. Morley
P.S. Here is the code I used to grab all of the quickeys from the ActionsPanel.xml file. I love E4X.
var quickeyXML:XML = {I pasted the XML from ActionsPanel.xml here}
for each (var element:XML in quickeyXML..@quickey)
{
trace("[Esc - "+element+"]");
}
Permalink
05.26.08
Posted in Browser, quicktip at 10:26 pm by Curtis J. Morley
Adobe Releases CS4 Beta Products
Well we knew it wouldn't be long after the public release of Flash Player 10 that CS4 Betas would be released. Currently you can download the beta of Dreamweaver CS4 and beta of Fireworks CS4. There currently is no Flash Beta but of course you can author for Flash 10 with Flex 3 and SDK 3.0.
Dreamweaver and Fireworks are excellent tools that if you don't have you should get soon. Especially with the new enhancements. Here is a summary from the Adobe Labs website.
DreamWeaver CS4:
- Live View
- Related Files
- Code Navigator
- CSS best practices
- Code hinting for Ajax and JavaScript frameworks
- HTML data sets
- Photoshop Smart Objects
- Subversion integration
- Adobe® AIR™ authoring support
- New user interface
Fireworks CS4:
- New user interface
- CSS-based layouts
- PDF export
- Live Style improvements
- Adobe type engine
- AIR authoring
Thanks,
Curtis J. Morley
P.S. I realize that the date on this post is before the actual date on Adobe Labs, but they always post the night before. It may have something to do with global time.
Permalink
03.15.08
Posted in Error, Error, Flash, Flex, errors, quicktip at 6:13 am by Curtis J. Morley
Warning: 1100: Assignment within conditional. Did you mean == instead of =?
Description:
AS3 warning 1100 is Adobe watching out for you and helping you out. Flash/Flex let's you know that you are assigning a variable while at the same time evaluating to see if it is true. This AS3 warning is quite easy to understand and well written.
Fix:
To solve Flex/Flash Warning 1100 all you need to do is add another " = " sign inside your conditional making 2 == rather than just one.
Bad Code 1:
if (topFive[i]="one") {
Good Code 1:
if (topFive[i]=="one") {
Note: This is not ActionScript Error #1100. Click this link to find AS3 Error #1100.
This should help you resolve Flash / Flex Warning #1100
Thanks and as always Happy Flashing
Curtis J. Morley
Permalink
03.06.08
Posted in Flash, Flex, Speaking, quicktip at 7:09 am by Curtis J. Morley
Thanks to Thor for having me come present in the Multimedia Dept. The class was great. As promised here are the links to examples, applications, and books that I talked about.
Applications that I have been a part of
Rifle Builder - Shopping Cart application built originally in Flash 5
LDS.org/cm - The Original Interactive Sheet Music Player
MusicRain.com - Commercial Interactive Sheet Music
LogoMaker.com - HP Purchased LogoMaker in-part because of the success of this application.
Thanksgiving Point Dinosaur Games - Click on the "Games and Coupons" button
RideHarder.com - New design by Element
SolutionOverview.com - Green Screen interactive video
BrainHoney - Learning tool for self publication, uses mashups and Facebook integration. upload whatever files you want and make a lesson or learn what you don't know.
Applications turned into web apps:
Photoshop:
http://www.flauntr.com/ -
http://www.picnik.com/app#/home/welcome -
http://www.splashup.com/ - Fauxto now caled Splashup This is the most fully featured one I have found.
Mapping -
FlashEarth.com -
maps.yahoo.com -
Microsoft Word:
BuzzWord.com
Grant Skinner Spell Checker for text editing
Image seam carving:
http://swieskowski.net/carve/ - Neat example
http://www.quasimondo.com/archives/000652.php - Example with code
http://rsizr.com/ this one is amazing and you can do it yourself
Video Editing:
RichFLV - Flash Based Video Editing Tool done with Flash/Flex and published with AIR
Motion detection & Vid Cam like Minority Report etc..
incomplet.gskinner.com
Sheet Music Applications -
LDS.org/cm - The Original Interactive Sheet Music Player
MusicRain.com - Commercial Interactive Sheet Music
Books:
Adobe Digital Editions
Quicken:
mint.com - Web based version of Quickenfor money management
The Radio:
www.pandora.com - the music genome project
iTunes:
www.anywhere.fm/player
Outlook:
www.goowy.com/index.aspx - Flash web based Outlook knock-off.
Great Books For Flash, Flex, and ActionScript -
ActionScript
Intermediate Books
Begining Books
Books not to buy
- AS3 Game Programming University
- Only buy this book if you have never used Flash. The games are good BASIC games but the graphics are horrible and the examples don't really teach the prinicples behind game design.
- Flash CS3 The missing manual.
- You might as well buy the Dummies book(see below) if you are going to buy this one. Not a good place to start. Not comprehensive. Not well written.
- Flash CS3 On Demand
- This book should not be allowed to be called CS3 because some of the examples are not even using AS3. If you own Flash 8 then you will want this book but not for CS3.
- Flash CS3 for Dummies
- You are not a dumb, but may feel like it after spending any money on this book. They do have good cartoons though.
Thanks,
Curtis J. Morley
Permalink
01.07.08
Posted in Error, Flash, Flex, Loops, errors, quicktip at 10:59 pm by Curtis J. Morley
ActionScript Warning: 3551: Appending text to a TextField using += is many times slower than using the TextField.appendText() method.
ActionScript Error Description:
I love this ActionScript Warning. This is not technically an ActionScript Error instead it is a warning that helps you code better. It is very clear and easily deciphered. This states that you should not use the old way to add text to a text field but rather use the new TextField.appendText() method. This improves performance dramatically and will prevent the user from getting the 15 sec. timeout. (Error #1502: A script has executed for longer than the default timeout period of 15 seconds.)
Fix:
Use TextField.appendText() instead of +=.
Bad Code:
var something:String = "Happy ";
var somethingElse:String = "Birthday";
myTF_txt.text = something;
myTF_txt.text += somethingElse;
Good Code:
var something:String = "Happy ";
var somethingElse:String = "Birthday";
myTF_txt.text = something;
myTF_txt.appendText(somethingElse);
ActionScript Warning #3551 is simple and easy (the way that all ActionScript errors/ warnings should be)
As always - Happy Flashing
Permalink
09.01.07
Posted in Flash, Flex, quicktip at 7:28 am by Curtis J. Morley
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.
- 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.)
- Copy and paste one of the code examples below into the XML file:
- Save the file.
- 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
Permalink
08.25.07
Posted in Flash, Flex, errors, quicktip at 5:42 am by Curtis J. Morley
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
Permalink
08.22.07
Posted in Flash, Flex, errors, quicktip at 5:43 am by Curtis J. Morley
I added a few more examples and a little more definition to ActionScript 3 Error #1078. There are now three code examples instead of just one and more in depth explanations to this error. I hope this helps you solve AS3 Error #1078.
ActionScript 3 Error #1078
Permalink
08.21.07
Posted in Flash, Flex, errors, quicktip at 8:43 pm by Curtis J. Morley
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
Permalink
08.20.07
Posted in Computers, Flash, Flex, errors, quicktip at 11:01 pm by Curtis J. Morley
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.

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.
Permalink
« Previous entries