SITE MOVING

NEW WEBSITE, I've moved everything to a new site. Its not just a blog anymore, its a full blown website.

REPEATE!: its not over just moving!

THE WEBSITE IS:
www.bxstudios.weebly.com

CHECK IT OUT FOR LOTS MORE TUTORIALS!

Welcome To Max's Flash Tutorials!

Here I will eventually post everything I know about flash. That ALOT! I am currently working on one of the best and far most interactive games I've ever made. Its called, "The Burbz RPG" and it will release some time in the summer of 08. That takes up a lot of my time but after I release the game on to the internet I will have a lot more time to write up tutorials.

Sections

Showing posts with label Interactivity. Show all posts
Showing posts with label Interactivity. Show all posts

Tuesday, February 26, 2008

How to use Alpha

Alpha is a function that turns an image in your flash file transparent or invisible. You may set it by turning your object into a movie clip, graphic or button. Click on it and bring up the "Properties" menu. On there, there will be a place to manually adjust the alpha or that movie clip, graphic, or button. But thats just the easy way, In this tutorial I am also going to teach you how to change it in action scripting so that it will change during the game.

The (AS) Script you will need is:
  • _root.object._alpha = 50;

Now the things you need to adjust to customize it to your personal needs is to change "object" to the Instance Name of your object. If you place the script on the object you want to use, make sure its a movie clip or button, and use "this" instead of "object". Then you change "50" to what ever transparence you want it to have. "0" is invisible, and "100" is solid.

If you want to put it on a button you will use this (AS) Script:

  • on (release) {
  • _root.object._alpha = 50;
  • }

You will need to change the same things in this one, plus where it says "release". You can change this to make it occure on "rollOver" or many other interactions of the button.

You can apply this into absolutly any different kind of script and once the program reads it, the alpha action will take place.

Wednesday, January 30, 2008

Ways To Use Variables

There are many ways, and reasons, to use variables. In a game: if you want to be able to buy something, keep stats, keep count of something, or make a true or false clause. In a video, or music player: you might want to keep a play count or something that adds up. Those are some of the reasons you might want to use variables.
First we will start our with in games...

Buy Something:
(COPY AND PAST THE WHOLE SCRIPT)
  • //script written by stat for buying something, a watch
  • //view more scripts for free at www.max-flashtutorials.blogspot.com
  • on (release){ //on release of the button
  • if (watch == false) { //if you dont already have the watch
  • if (money>49) { //if the equals money is 50 or higher
  • _root.money-=50; //you spend fifty dollars
  • _root.watch = true; //you now have the watch
  • _root.watchbutton._alpha = 0; //the button to buy the watch is now invisible
  • } //ends money if
  • } //ends watch is false if
  • } //ends on realse part
  • //script by stat

Copy and paste that script on the button. You will have to change the names of the variables to comply with the ones your working with, and the "watchbutton" should be the istance name of the button to buy what ever you are dealing with. Leave anything after the "//" it will affect nothing but will be helpful to look back on latter if you forget what something does or want to write your own script.

Keep Stats:

(COPY AND PAST THE WHOLE SCRIPT)

  • //script written by stat for buying something, a watch
  • //view more scripts for free at www.max-flashtutorials.blogspot.com
  • on (release) { // on the release of the button
  • if (money>19) { // if your money equals 20 or higher
  • _root.intelligence +=1; //intelligence is uped by one
  • } //ends money if
  • } //ends on release part
  • //script by stat

Copy and paste that script on the button. You will have to change the names of the variables to comply with the ones your working with. Leave anything after the "//" it will affect nothing but will be helpful to look back on latter if you forget what something does or want to write your own script.

Everything else is pretty much the same thing, you just use different variable names...

Please comment if you have any questions!