Flash and Javascript Communication – taterboy
August 20th, 2008 | Filed under: ActionScript 2, Flash, Tutorials

Passing Flash variables to Javascript, passing Javscript variables to Flash, Calling Flash functions from Javascript.

There are a few conventions for getting Flash and Javascript to communicate like fscommand, getURL, LocalConnection, URL-encoded variables, FlashVars, SetVariable and TCallLabel to name a few.

Here is a little demo using Flash’s External Interface and Javascript. It is more elegant then most of the procedures I have used in the past. Between External Interface and FlashVars, you should be able to fill most of your needs.
Read More »

Technorati Tags: , , , , ,


ActionScript 2 (AS2) SuperLoader – taterboy
August 13th, 2008 | Filed under: ActionScript 2, Flash, Free Components/Classes, Tutorials

Here is an AS2 version of the SuperLoader. It works just like the AS3 version found in the Custom HTML Templates post.

Quick Use:
1. Add loaderbar.swf and mainLoader.swf to your current project directory.

2. In the html file for your current project, replace the src and movie parameters to mainLoader.

3. Then add [,’flashVars’,’swfURL=FlashProjectToLoad.swf’] to the load script.
Read More »

Technorati Tags: , , , , ,

| No Comments »

SWF Files With Custom HTML Templates – taterboy
June 9th, 2008 | Filed under: Flash, Flash AS2 to AS3, Tutorials

AS3 Super Loader Part 2
This post is a continuation of the Action Script 3 Super Loader, though this tip could have many adaptations besides the example below.

Many may already know that when you go to the Publish Settings/ HTML window, there is a drop-down that allows for the choice of HTML templates to use with your .swf. When Flash publishes the HTML page along with the .swf, it dynamically creates the new HTML file that will host your Flash movie, with the correct width, height, file name, background color of the .swf in the source code. Many developers use this HTML page to copy the embed code into another file. Some people ignore this feature all together and use Dreamweaver to produce the code or have a custom HTML template that they modify manually.
Read More »

Technorati Tags: , , , , ,


Flash Actionscript 3 (AS3) Super Loader – taterboy
May 17th, 2008 | Filed under: Flash, Flash AS2 to AS3, Free Components/Classes, Tutorials

I really enjoy coding in AS3, but one of the things I dislike the most is the fact that when building movieclips as Classes, you have to export to Action Script or place all your movieclips on the stage somewhere. I think the latter is not very flexible. I understand why it has to be done; I just don’t like it. The problem with exporting everything to the Action Script is that it loads that MovieClip on the first frame, and loaders that are normally placed on the first frame will not show up or function until the first frame is loaded. This first frame now contains all our content that we have exported to Action Script which really defeats the purpose of a loader. That is why you will see a blank white box for a few seconds or longer before the loader shows up. The best way to fix this is to build a loader swf  to load our current project swf into. 
Read More »

Technorati Tags: , , , ,


What Happened to _global? – taterboy
April 13th, 2008 | Filed under: Flash, Flash AS2 to AS3, Tutorials

What happened to _global, _root, _level?

(Working With and Building Custom Events)

I rarely used _root or _level just because some projects would end up getting loaded into other swfs. Sometimes I didn’t know this until halfway through or in the end. So I started using global instead. That way I could still target the main timeline, which is where I would try to keep all my code, without having to worry about root moving somewhere else later. When I built components I would also use global, from time to time, to target them from anywhere in the application being developed.
Read More »

Technorati Tags: , , , , , , ,