THEACTIONSCRIPTER.COM
THEACTIONSCRIPTER.COM

Free Gucci Mane Flash Game

I recently developed a shooting game featuring Atlanta based rapper Gucci Mane.  Gucci Mane has recently been sent to jail and his fans want him out.  The games objective is to help free Gucci Mane from jail.  Try and freeze the guards with the ice gun (burrrrr) allowing enough time for Gucci to make his escape.  There is a helicopter waiting for the rapper at the end of the game to bring him to freedom. 

This game is an example on how you can use Flash and other online tools to market and promote music artists on the internet in a new hip way.  Simply add a sound track to the game and have their fans rock out while saving Gucci Mane.

 del.icio.us  Stumbleupon  Technorati  Digg 

Flash Input Text Font Issue with Mask

Why isn't my text showing up when I enter it in an input textfield?  That was the question I was asking myself.  Usually when I have an input text field the text shows up perfectly when keying inside it.  The reason I was having this issue was because my textbox was under a mask.

The solution:
Embed the characters needed like you would a dynamic text field.  That's it.

 del.icio.us  Stumbleupon  Technorati  Digg 

Developing Flash on a Mac vs PC



I finally did it.  I made the jump from PC to MAC.  I have been PC my entire life and figured it was about time to try out the MAC after all those commercials. I got a new MacBook Pro and it looks cool.  The keyboard lights up and everything. 

I have been developing Flash on it for the past month and came to some conclusions.  The Apple learning curve will take me longer than I thought.  I guess this is because I lived and died by the shortcuts on my PC.  I adjusted to the basic Apple differences quite easily, like using the command instead of the control key. The Flash shortcuts are what have been killing me.  F5 and F6 were not creating new keyframes or blank keyframes for me.  It took me a while to realize this was because you have to hit fn and F5 or F6.  So I had to do it the long way insert > timeline > Frame.

I guess part of my struggles is because I have a laptop with limited keys.  Not having a home and end key has also slowed me down. 

The positive thing about the switch has defiantly been dealing with my creative partners.  This was the main reason I made the switch.  Since the creative assets I get were designed by people using MACs a lot of time I would have missing fonts or fonts that were not compatible.  This doesn't happen anymore.

All in all I have mixed emotions on the switch from PC to MAC dealing with Flash development.  I have to say I miss my PC, like it more and much much faster with it, but time will tell.  Maybe in 3 months I will be singing a different tune when I know my MAC inside and out but until then I have to say,  "I am still a PC guy!".


 del.icio.us  Stumbleupon  Technorati  Digg 

AS 3 Hide/Show Mouse Cursor

Need the ActionScript 3 code to hide or show the mouse cursor?  Take a look below at it.  It is real simple.  Make sure you include the import.

Syntax:
import flash.ui.Mouse;

Mouse.hide();
Mosue.show();

 del.icio.us  Stumbleupon  Technorati  Digg 

Where Can I Find Omniture Flash ActionSource Documentation?

You can find a version of Omniture's ActionSource documentation for Flash/ActionScript implementation at the link below.

http://issuu.com/carismarie/docs/omniture_flash_documentation

 del.icio.us  Stumbleupon  Technorati  Digg 

Flash Making Extra Omniture Tracking Calls



Omniture tracking can be very tricky inside of Flash.  Omniture's introduction of ActionSource has made it easier to implement the tracking calls but there is still a number of issues that happens if not explained correctly.  One common mistake is extra tracking calls.  A lot of times when users click on different trackable components inside Flash the Omniture call gets triggered more than once.  This is becasue the Omniture call variables are not being nulled out after it is being fired.

When implementing Omniture on normal web pages each link click usually sends the user to a new http page.  Since the user is being sent to a new http page the Omniture variables are automatically refreshed because of the new http headers.  In Flash you have to refresh them on your own.

The example below shows an Omniture call in Flash via ActionSource that is not getting refreshed after the call is executed.  Since the variables are not being reset after the call, it is being saved in the ActionSource object and is being sent again on each of the next calls.

s.campaign = "Campaign Name";
s.pageName = "About Us";
s.eVar17 = "value";
s.track();


Since campaign, pageName and eVar17 have not been nulled out after s.track() was called, everytime s.track() gets called in the future it will continue to pass campaign, pageName and eVar17.  This will give you incorrect stats.  You may think you have gotten more hits related to that campaign or eVar than  you really did.

Solution:

s.campaign = "Campaign Name";
s.pageName = "About Us";
s.eVar17 = "value";
s.track();
s.campaign = null;
s.pageName = null;
s.eVar17 = null;


That is it.  Just null out the vars after you make a tracking call and you are good to go.

Let me know.

 del.icio.us  Stumbleupon  Technorati  Digg 

Connecting to a Web Service in Flex

I figured it was time to dive into Flex and see how different it is than Flash.  There are some differences but not too many.  For my first Flex project I decided to make an app to look up stock quotes.  I figured this would be a good place to start because communicating with web services is a common task for ActionScript projects.
 
In this example I used WebserviceX.NET Stock Quote free web service.  To connect to the webservice you have to instantiate a Web Service instance in your MXML file.  Below is example syntax to instantiate a WebService in your MXML.



id : name to identify your web service
wsdl : web service address
fault : function to handle faults when connecting to your web service
result : function that will be called after connecting to your web service

Now it is time to make the call to your web service.  The following code gets executed after the user clicks the search button.  This code lives inside the same MXML page inside an <mx:Script> tag.



We are almost done.  All we need to do now is display the results.  This code also lives inside the same MXML page inside an <mx:Script> tag.



Take a look at the demo below. Currently we are getting a security issue because this demo is trying to access data from another domain.  The solution is to add a crossdomain.xml in the root directory of the server but I do not have access to the blog's server root directory.  Please download the source MXML file and add it to your Flex project to see it running.



Source MXML File

 del.icio.us  Stumbleupon  Technorati  Digg 

Reading a RSS/Twitter feed with ActionScript 3

Everyone is tweeting!  Time to tweet in style.  Below is an example I made that reads in an RSS or Twitter feed and displays the entries inside a Flash component.

Try out this Flash RSS Feed Reader by entering your blog or Twitter's RSS feed below then clicking go.




How it works?

It is pretty simple to create your own Flash Twitter reader with ActionScript 3.  RSS feeds are read in similiar to XML.  After you read in the RSS feed loop through the RSS' channel items to display each entry. 


Let me know your thoughts or if you need to see any code.

 del.icio.us  Stumbleupon  Technorati  Digg 

AS3 :: Get all Children MovieClips

It is easy in ActionScript 3 to get all the chlidren instances of a MovieClip.  Take a look at the AS3 code below for help. 
for (var i:uint = 0; i < mcMain.numChildren; i++){ 
    txtOutput.htmlText += 'name:' + mcMain.getChildAt(i).name;
    txtOutput.htmlText += '\t type:' + typeof (mcMain.getChildAt(i));
    txtOutput.htmlText += '\t' + mcMain.getChildAt(i);
    txtOutput.htmlText += "";
}

The above code uses a for loop, to loop through the total number of children in mcMain.  mcMain.getChildAt(i) will get the reference to the child instance.  By tacking .name to the end of mcMain.getChildAt(i) you can get the name of the child object.

 

download source

 del.icio.us  Stumbleupon  Technorati  Digg 

AS3 MOUSE_OVER VS. ROLL_OVER

A lot of Flash developers I come across have an issue with mouse actions when MovieClips are embedded inside other MovieClips.  AS3 has multiple ways to handle embedded mouse actions within MovieClips.  The two main ways are MOUSE_OVER and ROLL_OVER.  They sound the same but have slight differences. 

MOUSE_OVER

MOUSE_OVER will be triggered when you first rollover the main MovieClip.  It will also be triggered every time you rollover any MovieClip inside the main MovieClip.  This can get dangerous when you have additional buttons inside the main MovieClip with MOUSE_OUT functionality.  Be careful because your MOUSE_OVER functionality will be called multiple times.

* If you set the main MovieClip to mouseChildren = false, it will prevent the MOUSE_OVER action being triggered when you mouse over any embedded MovieClip.  Be careful though because you will not be able to add any mouse actions to those embedded MovieClips.

ROLL_OVER

ROLL_OVER will be triggered when you first rollover the main MovieClip.  It will not be triggered again until you roll out of the main MovieClip and back over it.  You can rollover as many embedded MovieClips as you want without it being triggered multiple times.  ROLL_OVER is best for when you have embedded MovieClips with mouse actions.



 del.icio.us  Stumbleupon  Technorati  Digg 

Sponsored Links

Recent Entries

  1. Free Gucci Mane Flash Game
    Monday, January 18, 2010
  2. Flash Input Text Font Issue with Mask
    Tuesday, January 05, 2010
  3. Developing Flash on a Mac vs PC
    Tuesday, December 29, 2009
  4. AS 3 Hide/Show Mouse Cursor
    Tuesday, December 15, 2009
  5. Where Can I Find Omniture Flash ActionSource Documentation?
    Friday, November 06, 2009
  6. Flash Making Extra Omniture Tracking Calls
    Thursday, November 05, 2009
  7. Connecting to a Web Service in Flex
    Wednesday, November 04, 2009
  8. Reading a RSS/Twitter feed with ActionScript 3
    Tuesday, November 03, 2009
  9. AS3 :: Get all Children MovieClips
    Friday, October 09, 2009
  10. AS3 MOUSE_OVER VS. ROLL_OVER
    Tuesday, September 29, 2009

My Bukisa Articles


Subscribe


Blog Software