
In this Quick Tip, we’ll look at how to use the ExternalInterface class. This allows us to write AS3 which can run JavaScript code, and vice-versa. That means you can use Flash to alter parts of the webpage in which it’s running!
Step 1: Set up the Flash Document
Create a new Flash ActionScript 3 document. Resize the stage to be 600×300. With the rectangle tool, draw out a rectangle that is the size of the stage. Give it a color of #CCCCCC. Also, give it a black stroke of 2px.
Step 2: Set up the Flash UI
Here’s the layout we’ll be working towards:
Open the Components Panel (Window > Components) and, from the User Interface folder, drag a ColorPicker component onto the stage. Give it an instance name of ‘cp’.
Next create a dynamic text field called ‘resizeText’; place and size it however you please (you can’t see the…
1839 readersIn this Quick Tip you’ll learn how to measure the current frame rate of your Flash application using ActionScript 3, and display the FPS on screen. The Importance of Frame Rate Frame Rate, or Frames per Second (fps), is the frequency at which an imaging device produces unique consecutive images called frames. The term applies equally well to computer graphics, video
235 readersI spent a large portion of yesterday caught up in a bug. Basically, Flash would make a call to Javascript, and a while later, get a call back. It worked something like this: ExternalInterface.addCallback("callback", function ():void { ... }); ExternalInterface.call("doSomething"); Unfortunately it didn’t work. I thought I did everything right, I set allowScriptAccess to “always”, and
1956 readersIn this Quick Tip you will learn how to get the mouse’s current direction in your Flash application using AS3. You could use this to create an interesting control method for a game, using a mouse like a joystick, for example. For now we will just display the direction on screen. Preview Here’s a quick example to
1142 readers
2027 readers
1403 readersThis Quick Tip explains how to use an image as a website background and scale it proportionally to the stage size. It’s great for when you’re using a SWF that’s full-height and full-width inside a webpage. iMac icon by bobbyperux. Final Result Preview Take a look at what we’ll be working on. Resize your browser window and click
2546 readers
2181 readers
1514 readersIn this Quick Tip, you’ll learn how to detect when the user has been inactive for a determined time. Keep reading to find out how! Final Result Preview Let’s take a look at the final result we will be working towards: Step 1: Brief Overview We’ll detect users interaction using Keyboard and Mouse Events, checking for recent activity
2121 readersIn this Quick Tip, I will show you how to create a basic search application featuring the Google search engine. Final Result Preview Let’s take a look at the final result we will be working towards: Step 1: Brief Overview Using a TextField and some Events, we’ll send the search terms to Google and display
8,884
Subscribe to RSS headline updates from:
GurusUnleashed
Powered by FeedBurner
To apply: jobs@mediatemple.net
Subscribe to RSS headline updates from:
Design Jobs & Projects
Powered by FeedBurner
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

