Selection Border around Flash content in Firefox 3+

This pesky little problem has been niggling away at me for months, so I finally decided to investigate the problem and find a solution.

It appears as though this is only a problem in Firefox 3+ when you set the 'wmode' parameter to transparent. Now I'm no browser compatibility expert so I'll take someone else's word on this but Firefox renders and handles the default style of the outline property of the object tag differently to other browsers.

Solution

Set the object tag's outline property to 'none'

object { outline:none; }

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comparing Class names

In the most recent project I've been developing I've needed to match up or pair a class name with an identifier from an XML file. Something like this:

<spriteID>SomeClass</spriteID>
[object SomeSprite]

A possible solution to achieve this is demonstrated pseudo code below.

var stageSprite:Object = stageSprit;
var stageSpriteClass:Object = Object(stageSprite).constructor;
var xmlClassName:Object = getDefinitionByName(xmlSpriteID);

if(stageSpriteClass == xmlClassName){
   return true;
}

 Usually you can achieve this dynamically without the need to to compare and associate clips but in case you need to do it this way, you now know how.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

FileReference and Scope

For the first time today i used FileReference in Actionscript. There are multiple uses of this but the one i was interested in concerned downloading. I jumped into *Flash's intuitive help section* and attempted to perform the desired outcome (saving an mp3 file locally).

So it all worked great, until i tried to save the file. Nothing happened after pressing save in the dialog box. Turns out the culprit was scope. I created a local function instance of FileReference instead of creating a class instance. When the dialog box opens it needs a reference it can get back to otherwise it's lost and the operation can never be completed.

For a more structured walkthrough check out Adobe's help on the matter.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Alternative Debugger

De MonsterDebugger is an Air application from De Monsters that comes with a handy set of features. One of its better known features includes editing properties and calling methods at runtime. This alone definitely makes it a nifty little debugger. It also displays xml as a tree that is collapsable and expandable. At times the overall tree structure can be somewhat clunky but it's enough to get me using it. The only catch with these perks is that all your properties and methods need to be public so that they are accessible.

To enable MonsterDebugger in your application instantiate it first like this:
this.monsterDebugger = new MonsterDebugger(this);
this is the reference to the root of the application. This line alone allows to modify methods and properties throughout your application.

To make a trace you would write this:
MonsterDebugger.trace(this, xml);
this is the reference targeted object.

One last thing to consider is that you export the classes needed for MonsterDebugger from the Air application to the client side folder. To do this navigate to the following in the Air app:
File > Export Client Class
Point to the folder that contains all your application's classes

Download the Air application Version 2.51

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Linking to URLs in a standalone player

You aren't allowed to link to external URLs that aren't in th esame domain from the standalone desktop player.

Why? It could be a file that you've download and could take you to a site that may harm your computer.

What you can do:
- Make it an AIR app
- Make it a projector (.exe .app)

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Implementing swfaddress

In its most basic implementation swfaddress enables developers to deep link their project and incorporate browser functionality into their flash applications. This is pretty clever but it also has some pitfalls if not implemented correctly.

I recently worked on a project that required this functionality and experienced some unwanted behaviour i thought i would share.

- Earlier versions of swfaddress can break flash applications in browsers specific browser. (IE7 + 6)
- Be sure to handle situations when an incorrect URL is entered through the browser
- To err on the side of caution always make your application react and animate AFTER the URL in the browser has changed.

The below link is a folder i created that has the required assets to implement swfaddress in your project. This is version 2.4 and i can confidently assure its stability across all browsers. It contains the AS3 classes and javascript file needed. It does not contain working examples or instructions on the implentation, that can be found at the swfaddress site.

SwfAddress Assets.zip (10.98 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Introduction to 3D in Flash

Found a decent tutorial from the Away3D blog that runs through all the basics of 3D in Flash.

 No doubt some topics will be really simple and familiar but it's great in that it gives a brief overview and some nifty examples.

http://www.flashmagazine.com/Tutorials/detail/flash_3d_basics/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Using Variables in XML

Everytime I use xml internally in actionscript I always forget how to make use of variables and constants.

Take the follwoing code:

 <player name="Brenton" number="7" position="RW">
        <round number="1" goals="7" assists="4" foulsFor="1" foulsAgainst="2" saves="0" goalsConceded="0" bonus="3" />
</player>

Now as there begins to be multiple players the round number will be generic between players so we might as well make it a constant.
This is achieved by adding curly braces {} around the constant name. {ROUND_1}

 <player name="Brenton" number="7" position="RW">
        <round number={ROUND_1} goals="7" assists="4" foulsFor="1" foulsAgainst="2" saves="0" goalsConceded="0" bonus="3" />
</player>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Smooth all Bitmaps in your library

Inspired by a command from a fellow flasher i went on the hunt for a command that smooths all bitmaps in your library for you. First hit in google and we were away.

Here is the site that the file is located: http://mrsteel.wordpress.com/

AllowSmoothing.jsfl (233.00 bytes)

Enjoy!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

This One's For You Jesus

Ahoy, it's been a while so i thought i would update you on what has been keeping me busy over the past few weeks. I've managed to squeeze in a few hours of uni work here and there but this game has been a hit at uni. Jump high, dazzle with a few flips here and there and see if you can get as far as those freaks on youtube... 

Take a look at Alan Rawkins' game Dolphin Olympics 2

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5