flash example

warning: Creating default object from empty value in /home/nbilyk/nbilyk.com/wwwroot/modules/taxonomy/taxonomy.pages.inc on line 34.

XML Namespaces

This article isn't to teach you what namespaces are, how they work, and why you would use them, this article is just to help you take the first step to figuring out how to parse xml with namespaces in it.

var xml:XML = <root>
	<h:table xmlns:h="http://www.w3.org/TR/html4/">
	  <h:tr>
	    <h:td>Apples</h:td>
	    <h:td>Bananas</h:td>
	  </h:tr>
	</h:table>
 
	<f:table xmlns:f="http://www.w3schools.com/furniture">
	  <f:name>African Coffee Table</f:name>
	  <f:width>80</f:width>
	  <f:length>120</f:length>
	</f:table>
 
</root>


Read more...

Make scrolling in flash not scroll in browser

I found a great article I thought I'd share:
http://avatar-soft.ro/blog/?p=4

It's how to prevent your browser from scrolling when you are scrolling with flash content.

I fixed a minor bug and made it as a js file, so to use it, just download the js file (remove the .txt) and add this to your html code.

  <script type="text/javascript" src="hookMouseWheel.js"></script>

Easy enough?


Read more...

Variables and constants

Actionscript 3 guide to constants and variables.

This article assumes you have a knowlege of Classes and instances.

public class Cow extends Mammal {
	protected static const NUM_LEGS:uint = 4;
}

Let's dissect this cow, specifically, the NUM_LEGS constant.

There are 6 parts to this declaration:
protected
static
const
NUM_LEGS
:uint
4

I'm going to explain them backwards in order to go from simplest to most complicated.


Read more...

Flash E4X Tutorial

This is a beginner's guide to E4X.
Flash has some good documentation on using E4X at:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html?XML.html&class-list.html,
but it's hard to digest all that if you're just getting started.

You can download the example attached below and follow along.


Loading xml

Before we begin parsing any xml, I'll explain briefly how to load the xml.


Read more...

Copying typed objects

Attached below is a utility class with 3 static methods:

  • clone
  • compare
  • mergeObjects

Clone lets you copy Objects and Arrays. If you copy a different class, the public properties (and recursive public properties) will get transferred, but the private properties won't. Also, the cloned object can only be of type Object or Array.

Compare lets you compare recursively the public properties of two objects or arrays. Useful for multi-dimensional arrays.


Read more...

Flash Localization Example

Localization, Internationalization, or I18N, whatever you want to call it, is just a way to separate your text from your interface so that it can be translated and/or maintained apart from your application.

There are many benefits to this, even if you never plan on having your application in multiple languages. Localization makes your program more maintainable, easier to update, and more flexible to change.

Here's how to localize your content in Flash. It's a lot easier than you might think!

First, open your strings panel:


Read more...

Function Limiter Example

An example using the FunctionLimiter class. This class is to limit the frequency of which a function gets called.


Read more...

Pivot Rotate Example

The PivotRotate utility class allows you to rotate around a pivot point in flash instead of just the 0, 0 point.


Read more...

Flash Grid Layout Example

This example shows some more of the advanced things you can do with the GridLayout.


Read more...

Layout Managers Example

This example shows you how to use the flow layout manager, grid layout manager, animated flow layout manager, and animated grid layout manager. The example itself will generate the code needed to get you started.


Read more...
Syndicate content