Thursday, October 16, 2008

Notes class 4 oct 1

Loader is like an empty container. It pulls things into the flash thing but you can also move the loader around on the screen with the thing inside it as though you are actually moving the thing.

Library materials need to be downloaded before the flash file will play. You can put things in loaders and the content that you need will be put on the screen when it’s asked for instead of all the assets being loaded before the file plays. Think of it like a web page that loads content when it needs it.

Number 42

Has jpg image in the same folder as the flash file. Will work fine if it’s loaded to the web that way.
Loaders are invisible until they have content. When the image is on the internet. It may take a few seconds for the image to download. The loader is attached to the stage so it will just immediately appear. You won’t see it until the image is downloaded but it is there and invisible. If you don’t change it, it will stretch to fill the size of the image



Number 45
Can use this code to download an image and then use max----- to fade the image in. the event:Event lets you know the image has finished so you can then use the fade. It listens to the content inside the loader rather than the loader itself.

Number 46
Has an even loader code example. ProgressEvent





Don’t use loaders for sound or video. Use loaders for images.



ARRAYS


Programming concept. Hard to get your head around this. No reason to suffer.

Variable is a bucket we pour content into. Holds 1 thing. Numbers or other stuff.

Array is a list. Can think of it as a database.

Flash arrays are untyped. You can put any values into an array and they don’t have to be the same kind of data. Numbers, text string, song, movie clip, image.

Array is an object. Create an object and then stuff some things into it. Start with number 0.

Array notation = name[1]

name[1] = 4; // this would make the location 1 value equal to 4.


Reverse starts at the end and goes backwards. There are lots of other array functions to use.


Number 52
Push and pop stacking of the array.
oneArray.push(6); /// pushes a value onto the stack.
// pop takes the last value off the top of the array




XML


Number 54

Xml describes the order and structure of the data. It’s a way of passing data to flash. You can use itunes music library to get xml data to the music. It’s a really good way of passing data to applications.

How you structure the data depends on how you want to use it and what you want to get from it. All tags need valid closing tags.

The order they come in is what is important. The names are for you to understand what you have as data.

Speak to the xml file just like you speak to an image, same path structure.
Flash has loadXML shown as an xml listenter in number 54


E4X a language to talk to xml. Treat it like an array.


Public class can be read by anything else but it can also be changed by some other part of flash. Private classes / functions can only be seen by themselves but they can’t be changed by any other part of flash.

No comments: