Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Byte Array Action script2 2.0

Posted on 2006-07-24
2
Medium Priority
?
225 Views
Last Modified: 2011-10-03
How can you declare a byte array with Action scripts version 2.0?

cheers

apb2
0
Comment
Question by:apb2
2 Comments
 
LVL 7

Accepted Solution

by:
muxxter earned 2000 total points
ID: 17171996
Hi apb2.

Actionscript doesn't actually have a byte class. It does, however, have a Number and String class. You can use a String object like a character array, almost (like in the various flavours of C). But it isn't as elegant:

my_str.charAt(<index>);

It all depends on what you want to store in each byte. If you're using it as a less memory intensive integer, you're only option is to make an array of Number objects. If you're storing characters, you can use the String class. Or, to stick with the array functionality, you'd have to make an array of Strings. Each one being only one character long. However, if you do it this way, when you try to print out the array, you get a "Object [Array]" statement, instead of the word that it represents.

I hope this helps. :-)
MuXx
0
 
LVL 6

Author Comment

by:apb2
ID: 17182527
Cheers mate
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question