Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Actionscript Clean-up



Hi there...when using Flash MX, is there any way to clean up this coding to hasten the load time of the data into flash from the large text file holding the data?

stop();
for (a1=1; a1<=_root.limit; a1++) {
_root["b"+a1]._visible = 0;
}
String.prototype.mysplit = function (ch) { var k, s, l = this.length;var res = new Array();for (k=s=1; k<=l; k++) {if (substring(this, k, 1) == ch) {res.push(substring(this, s, k-s));s = k+1;}}if (s<=l) {res.push(substring(this, s, l-s+1));}return res;};
for (a1=300; !(Number(_root[a1].substr(0, 1))) & a1>0; a1--) {
;
}
// checks how many players there are
_root.nplayers = a1;
_root.players = new Array();
for (a1=1; a1<=_root.nplayers; a1++) {
_root.players[a1] = _root[a1].mysplit(",");
}
_root.strt = 1;
for (a1=0+_root.strt; a1<=_root.nplayers && a1-_root.strt<_root.limit; a1++) {
_root["b"+a1]._visible = 1;
_root["b"+a1].pl = _root.players[a1][1];
_root["b"+a1].score = _root.players[a1][2];
_root["b"+a1].holes = _root.players[a1][3];
if (_root["b"+a1].score>0) {
_root["b"+a1].score = "+"+_root["b"+a1].score;
}
rules = new Array(5, 3, 4, 4, 4, 5, 4, 3, 4, 4, 4, 4, 3, 5, 4, 3, 4, 4);
higher = "#66CC00";
lower = "#FF0000";
equal = "#000000";
_root.datas.pl = _root.players[1][1];
_root.datas.tt = _root.players[1][4];
_root.datas.sscore = _root.players[1][5];
}
if (_root.datas.sscore>0) {
_root.datas.sscore = "+"+_root.datas.sscore;
}
_root.datas.cscore = _root.players[1][6];
for (a1=1; a1<=18; a1++) {
_root.datas["scr"+a1] = _root.players[1][6+a1];
if (Number(_root.datas["scr"+a1])>rules[a1-1]) {
_root.datas["scr"+a1] = "<FONT COLOR = ""+higher+"">"+_root.datas["scr"+a1]+"</FONT>";
} else if (Number(_root.datas["scr"+a1]) == rules[a1-1]) {
_root.datas["scr"+a1] = "<FONT COLOR = ""+equal+"">"+_root.datas["scr"+a1]+"</FONT>";
} else if (Number(_root.datas["scr"+a1])<rules[a1-1]) {
_root.datas["scr"+a1] = "<FONT COLOR = ""+lower+"">"+_root.datas["scr"+a1]+"</FONT>";
}
}
_root.datas.tout = _root.players[1][25];
_root.datas.tin = _root.players[1][26];
_root.datas.ttl = _root.players[1][27];
_root.datas.egs = _root.players[1][28];
_root.datas.bds = _root.players[1][29];
_root.datas.prs = _root.players[1][30];
_root.datas.bgs = _root.players[1][31];
_root.datas.dbgs = _root.players[1][32];
_root.datas.otr = _root.players[1][33];
_root.datas.acs = _root.players[1][34];



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-08-2003, 09:15 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Clean Actionscript
Hi,

I have a movie clip that loads xml data and dynamicaly resizes accordingly, this all works fine but I would like to resize the movie from the top left-hand corner. I have found a script that works great, but I need to somehow incorporate it into my existing script. My current movie uses two actions layers to control the dynamic data. I would like to stay away from using arrays as I have managed fine so far without using them. I really just want to get the resize function working slightly diferently.

I am actually after two different things here:

a) My dynamic resize to work like 'Resize Script Tutorial'
(I need some real help with this, as i have tried going through the code line by line to seee what is happening, but my changes are not working)

b) My two actions layers to be combined (Hints or reference to good coding practices are probably all I need with this one)

1. Resize Script Tutorial - this is what I want to achieve

Code:
spacing = 0;
containerMC._alpha = 0;
var pArray = new Array();
var tArray = new Array();
var cur;
MovieClip.prototype.loadPic = function(pic) {
cur = pic;
this._alpha = 0;
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (l == t && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
bar._visible = 0;
containerMC._alpha = 0;
picinfo.info.text = tArray[pic];
delete this.onEnterFrame;
} else {
bar._width = per;
picinfo.info.text = per+" % loaded";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 7;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
shadowFollow();
prevb._x = nav._x-5;
nextb._x = nav._x+this._width+5;
nextb._y = prevb._y=this._y-this._height/2;
picinfo._y = nextb._y-5;
picinfo._x = border._x-picinfo._width/2;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x;
containerMC._y = this._y;
containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
trace(gallery.childNodes.length)
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes[i].attributes.title);
pArray.push(gallery.childNodes[i].attributes.image);
}
containerMC.loadPic(0);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("gallery.xml");
2. My dynamic resize actions layer that resizes the movie clip

Code:
space = -20;
image_mc._alpha = 0;

MovieClip.prototype.loadPhoto = function(photo){
image_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up
// to smaller number.
var total = Math.round(image_mc.getBytesTotal()/1024);
var loaded = Math.round(image_mc.getBytesLoaded()/1024);
var t = image_mc.getBytesTotal()/1024;
var l = image_mc.getBytesLoaded()/1024;
bar._visible = 1;
load._visible = 1;
per = Math.round((l/t)*100);
if (total != 0 && loaded>=total){
var w = image_mc._width + space;
var h = image_mc._height + space;
border._alpha = 100;
border.resize(w, h);
bar._visible = 0;
load._visible = 0;
delete this.onEnterFrame;
} else {
bar.mask._width = per;
load.info.text = per+"%";
}
}
};
MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if(Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
image_mc._x = this._x - this._width/2 + space/2;
image_mc._y = this._y - this._height/2 + space/2;
image_mc._alpha = 100;
border._alpha -= 50;
delete this.onEnterFrame;
}
}
};
3. My XML actions Layer that loads the images from the XML file

Code:
var thumb_spacing:Number = 30;

var thumb_xCo:Number = 0;
var thumb_yCo:Number = 50;

var instanceName:String;

var description_lv = new LoadVars();
description_lv.onData = function(raw_text) {
description_txt.text = raw_text;
}

function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures[i];
instanceName = "thumbnail_mc" + i;
menu_mc.createEmptyMovieClip(instanceName,i);
menu_mc[instanceName]._x = thumb_xCo;
menu_mc[instanceName]._y = thumb_yCo;
thumb_xCo += thumb_spacing;
if ((menu_mc[instanceName]._x + thumb_spacing) > 145) {
thumb_yCo += 30;
thumb_xCo = 0;
}

menu_mc[instanceName].createEmptyMovieClip("thumb_container",0);
menu_mc[instanceName].thumb_container.loadMovie(currentPicture.attributes.thumb);

menu_mc[instanceName].title = currentPicture.attributes.title;
menu_mc[instanceName].image = currentPicture.attributes.image;
menu_mc[instanceName].description = currentPicture.attributes.description;

menu_mc[instanceName].onRollOver = function() {
this.thumb_container._alpha = 50;
}
menu_mc[instanceName].onRollOut = function() {
this.thumb_container._alpha = 100;
}
menu_mc[instanceName].onRelease = function() {
image_mc.loadPhoto(this.image);
description_lv.load(this.description);
title_lv.load(this.title);
}
}
}
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
if (success) {
GeneratePortfolio(this);
} else { error.error_info.text = "XML loading error";
}
}
portfolio_xml.load("../home/best_of/best_of.xml");

How To Clean A MC? Thank You.
Hello,

i inserted 3 lines of code to attach 3 MC's:

_root.attachMovie("rect","player",0,playerInitObj) ;
_root.attachMovie("rect","opponent",1,opponentInit Obj);
_root.attachMovie("ball","ball_mc",2,ballInitObj);

How do i make them disapear?

Thank You,
Miguel

Clean
ok iv made 1 site ever in flash, and its worked alright, but it just didnt have a cleane effect that everyone elses does.

if some oen could shout me some cleane ways of changing the main page(through navigation)

like the transistion when you press between buttons.

thatd be awsome thnx, livo

How Should I Clean This Up
hey guys,
i have this problem where the scripts that i write are usually repetative and messy. they usually do the job, but i would prefer to have a script which does the job and also seems more professional.
for example this script:

code:
A = 3;
F = 1;
M = 0;
V = 1;
O = 1;
boxno = 1;
for(i=1;i<=A;i++){
this["box"+boxno].gotoAndStop("A"+i);
boxno+=1;
}

for(j=1;j<=F;j++){
this["box"+boxno].gotoAndStop("F"+j);
boxno+=1;
}

for(k=1;k<=M;k++){
this["box"+boxno].gotoAndStop("M"+k);
boxno+=1;
}

for(l=1;l<=V;l++){
this["box"+boxno].gotoAndStop("V"+l);
boxno+=1;
}

for(m=1;m<=F;m++){
this["box"+boxno].gotoAndStop("O"+m);
boxno+=1;
}


i know this script is crap. it works but you can see how ive just thrown it all together.
how would one go about making this script smaller or getting rid of the repetative nature.
also if you have any links on how to write good scripts, guidelines for how scripts should be written, that would help me out alot.
these scripts work, but theyre a ***** to edit.
thanx in advance
Ross

What Do I Have To Clean Up?
Currently I am cleaning up events after I finish using them. For example....

addEventListener(Event.ENTER_FRAME, contRefresh);

...after using it I do the following....

removeEventListener(Event.ENTER_FRAME, contRefresh);

If I don't do this it seems to be continuously doing wasting my CPU....

Now for the questions....


(Question 1) if I have a movieclip A which has a child movieclip B, if I remove A does this automatically remove B too from memory?

(Question 2) I'm still learning actionscript 3.0 and would like to know what other stuff I have to clean up (examples please!).

CLEAN TEXT
how the heck do you do this sort of action script???

Check out http://www.methodologie.com > us > people > click on any name

and the text is so cool. cause when right click on the text, it has a different menu, whereas when i left then right click, the regular flash menu pops up!!!

teach me! anyone!!!

thanks.

-james

Getting A Clean Professional Look
I'm a newbie to flash, and I guess I'm in the stage of being completely in awe of every neat website I see that is made with flash. My favorite so far is http://www.pixelranger.com. I have noticed a sort of universal style for a lot of flash: a clean, thin-lines-box style with gradients and interesting fonts. http://www.pixelranger.com has some, http://www.madrhino.com has some, http://www.2advanced.com/ has some, http://www.gmunk.com/2001_seattle/ has some. A lot of really popular sites share some basic clealiness principles. I think thats what it should be called. So my question is: what is the design process for getting that style? Where does everyone get those fonts? THey all look very similar to me. What program is used? I prefer illustrator to the flash drawing tools, do most people use illustrator or flash or corel draw? Could anyone send me a .fla of a site similar to those I listed? And if you don't understand what I'm getting at with this similar style thing ask and I'll try to elaborate.

Clean Up Advise
I have a flash site that has 100+ buttons in the library. About 50-60 of them are being used in the movie. Can anyone give any advise on the easiest way to clean up my library. There has been several different hands in this project so that the naming conventions of the buttons also need to be cleaned up.

One way I came up with is to go to the Movie Explorer and print out the buttons/movies/graphic. Can anyone tell me if these are buttons that are used in the movie or does this screen show the ones not being used as well.

Does anyone know of a better way of doing this?

Clean Picture
what is the best way to get a super clean picture in my flash movie

Keeping The URL Bar Clean...
Hi,

I'm wondering, how do some people keep the URL-address bar clean? By this, I mean that even if the actual address was www.mywebsite.com/folder/folder/something.htm, I'd still want the address bar to show www.mywebsite.com.


I've seen this on a few websites... ideas on how to do this anyone?

Qasim.

Clean Effect
Can anyone give me a ideea how to make a clean effect, u know that bright star that appears in cleaning products publicity.

Thank you very much.

Please Clean Up Line For Me
Hey there!
Im building a tween prototype and it works great, but the argument with the delete onEnterFrame is a bit sloppy. How can I write it using the var i in the for loop?

Cheers!

code:
MovieClip.prototype.tween = function(prop, finalValue, tweenSpeed) {
var prop:Array;
var finalVal:Array;
var tweenSpeed:Number;
var finished:Number;
if (tweenSpeed == undefined) {
tweenSpeed = .09;
}
this.onEnterFrame = function() {
for (var i = 0; i<=(prop.length-1); i++) {
//easeOut
this[prop[i]] += (finalValue[i]-this[prop[i]])*tweenSpeed;
//easeOutElastic
if (parseInt(this[prop[i]]) == parseInt(finalValue[i])) {
delete finalValue[i];
if (finalValue[0] == undefined && finalValue[1] == undefined && finalValue[2] == undefined && finalValue[3] == undefined && finalValue[4] == undefined && finalValue[5] == undefined && finalValue[6] == undefined && finalValue[7]) {
delete this.onEnterFrame;
}
}
trace(this[prop[i]]+" / "+finalValue[i]);
}
};
};
//
onMouseDown = function () {
box.tween(["_xscale", "_yscale"], [400, 500], .09);
};

Coders HELP Clean This Up
OK this is the rollover code for a drop down sub menu.

It kinda works except the prevFrame doesnt seem to work and it seems excessive code.... especially when I have 5 buttons and id have to do this 5 times!!!


Code:
_root.menu_mc.multiBut.onRollOver = function() {
if (_root.dropMenu._currentframe<53) {
_root.dropMenu.onEnterFrame = function() {
_root.dropMenu.nextFrame();
if (_root.dropMenu._currentframe == 53) {
_root.dropMenu.onEnterFrame = function() {
_root.dropMenu.stop();
if (_root.dropMenu._currentframe>53) {
_root.dropMenu.onEnterFrame = function() {
_root.dropMenu.prevFrame();
if (_root.dropMenu._currentframe == 1) {
_root.dropMenu.onEnterFrame = null;
}
};
}
};
}
};
}
};

_root.menu_mc.homeBut.onRollOver = function() {
if (_root.dropMenu._currentframe<79) {
_root.dropMenu.onEnterFrame = function() {
_root.dropMenu.nextFrame();
if (_root.dropMenu._currentframe == 79) {
_root.dropMenu.onEnterFrame = function() {
_root.dropMenu.stop();
if (_root.dropMenu._currentframe>79) {
_root.dropMenu.onEnterFrame = function() {
_root.dropMenu.prevFrame();
if (_root.dropMenu._currentframe == 1) {
_root.dropMenu.onEnterFrame = null;
}
};
}
};
}
};
}
};
Help me coder gods!

Flash And Clean URL's
So I embedded a flash movie, using wmode so that the content div layer would be over it. The thing is, my coding uses clean urls, hence everytime I go to a new article or so forth, the flash movie doesn't show up. When I tried to put it in directly, than the buttons don't load. I tried the 'base' attribute as well, but I think base attribute is more for the buttons and url's within the flash movie itself- not the page load. So if you could help me:

http://mycurry.net/

As you can see, if you go to the "disclaimer" or buttons on the top, the flash disappears.

Clean Up Library
Is there an easy way to clean up any unused files within my library?

How To Clean Up Code
I'm a novice at actionscript. I have used it on and off for the past few years but never really become efficient because I don't use it enough. Anyway, I'm working a menu system and I think my code is, shall we say verbose. I need some advise on how I can condense the code. There are also some things I'm trying to figure out how to do so if you have any advise it would be appreciated. Please take a look at the attached files.

Can You Clean Up My Code?
Hi guys!

I've been making a photo gallery with thumbnails that "pop" out and back again when you click on them.

I've laboriously typed out the code for each one of the 8 photo movieclips and I'm sure there's a cleaner, easier way to do it - I just don't know how.

I've tried concatenating strings and variables to target the photo movieclips, but I can't get it to work and so I can't set up any 'neat' loops that do all the clips with just one bit of code... if you get what I mean.

This code is on the main timeline:


Code:
resetAllPhotos();
//Scale and position the photos
function resetAllPhotos(){
//Set the x and y co-ordinates for original photo positions:
xa = 85;
xb = 205;
xc = 430;
xd = 660;
xe = 785;
ya = 90;
yb = 135;
yc = 270;
yd = 405;
ye = 440;
//Set photo1
photo1._xscale = 20;
photo1._yscale = 20;
photo1._x = xc;
photo1._y = ya;
photo1zoomedIn = false;
//Set photo2
photo2._xscale = 20;
photo2._yscale = 20;
photo2._x = xd;
photo2._y = yb;
photo2zoomedIn = false;
//Set photo3
photo3._xscale = 20;
photo3._yscale = 20;
photo3._x = xe;
photo3._y = yc;
photo3zoomedIn = false;
//Set photo4
photo4._xscale = 20;
photo4._yscale = 20;
photo4._x = xd;
photo4._y = yd;
photo4zoomedIn = false;
//Set photo5
photo5._xscale = 20;
photo5._yscale = 20;
photo5._x = xc;
photo5._y = ye;
photo5zoomedIn = false;
//Set photo6
photo6._xscale = 20;
photo6._yscale = 20;
photo6._x = xb;
photo6._y = yd;
photo6zoomedIn = false;
//Set photo7
photo7._xscale = 20;
photo7._yscale = 20;
photo7._x = xa;
photo7._y = yc;
photo7zoomedIn = false;
//Set photo8
photo8._xscale = 20;
photo8._yscale = 20;
photo8._x = xb;
photo8._y = yb;
photo8zoomedIn = false;
}
//Import the Tween and easing classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
function zoomIn(){
resetAllPhotos();
target.swapDepths(999);
//Rescale the photo to 100% and move it to the centre
var zoomInX:Tween = new Tween(target, "_xscale", Elastic.easeOut, 20, 100, 1, true);
var zoomInY:Tween = new Tween(target, "_yscale", Elastic.easeOut, 20, 100, 1, true);
var moveX:Tween = new Tween(target, "_x", Elastic.easeOut, target._x, 430, 1, true);
var moveY:Tween = new Tween(target, "_y", Elastic.easeOut, target._y, 250, 1, true);
}
function zoomOut(){
resetAllPhotos();
//Rescale the photo to 20% and return it to the original position
var zoomOutX:Tween = new Tween(target, "_xscale", Elastic.easeOut, 100, 20, 1, true);
var zoomOutY:Tween = new Tween(target, "_yscale", Elastic.easeOut, 100, 20, 1, true);
var moveBackX:Tween = new Tween(target, "_x", Elastic.easeOut, 430, target._x, 1, true);
var moveBackY:Tween = new Tween(target, "_y", Elastic.easeOut, 250, target._y, 1, true);
}
//Photo1 zoom in or out on mouse click
photo1.onRelease = function(){
target = photo1;
if(photo1zoomedIn == false){
zoomIn();
photo1zoomedIn = true;
}else{
zoomOut();
photo1zoomedIn = false;
}
}
//Photo2 zoom in or out on mouse click
photo2.onRelease = function(){
target = photo2;
if(photo2zoomedIn == false){
zoomIn();
photo2zoomedIn = true;
}else{
zoomOut();
photo2zoomedIn = false;
}
}
//Photo3 zoom in or out on mouse click
photo3.onRelease = function(){
target = photo3;
if(photo3zoomedIn == false){
zoomIn();
photo3zoomedIn = true;
}else{
zoomOut();
photo3zoomedIn = false;
}
}
//Photo4 zoom in or out on mouse click
photo4.onRelease = function(){
target = photo4;
if(photo4zoomedIn == false){
zoomIn();
photo4zoomedIn = true;
}else{
zoomOut();
photo4zoomedIn = false;
}
}
//Photo5 zoom in or out on mouse click
photo5.onRelease = function(){
target = photo5;
if(photo5zoomedIn == false){
zoomIn();
photo5zoomedIn = true;
}else{
zoomOut();
photo5zoomedIn = false;
}
}
//Photo6 zoom in or out on mouse click
photo6.onRelease = function(){
target = photo6;
if(photo6zoomedIn == false){
zoomIn();
photo6zoomedIn = true;
}else{
zoomOut();
photo6zoomedIn = false;
}
}
//Photo7 zoom in or out on mouse click
photo7.onRelease = function(){
target = photo7;
if(photo7zoomedIn == false){
zoomIn();
photo7zoomedIn = true;
}else{
zoomOut();
photo7zoomedIn = false;
}
}
//Photo8 zoom in or out on mouse click
photo8.onRelease = function(){
target = photo8;
if(photo8zoomedIn == false){
zoomIn();
photo8zoomedIn = true;
}else{
zoomOut();
photo8zoomedIn = false;
}
}

Clean My Code...
There has to be a more efficient way to do this, with less lines of code.


Code:
function calculate() {
if (calculatorTotal == 0) {
liberalSeats = 45
conservativeSeats = 52
ndpSeats = 10
} else if (calculatorTotal == 1) {
liberalSeats = 47
conservativeSeats = 50
ndpSeats = 10
} else if (calculatorTotal == 2){
liberalSeats = 50
conservativeSeats = 47
ndpSeats = 10
} else if (calculatorTotal == 3){
liberalSeats = 52
conservativeSeats = 45
ndpSeats = 10
} else if (calculatorTotal == 4){
liberalSeats = 54;
conservativeSeats = 43;
ndpSeats = 10;
} else if (calculatorTotal == 5){
liberalSeats = 56
conservativeSeats = 41
ndpSeats = 10
} else if (calculatorTotal == 6){
liberalSeats = 59
conservativeSeats = 39
ndpSeats = 9
} else if (calculatorTotal == 7){
liberalSeats = 61
conservativeSeats = 37
ndpSeats = 9
} else if (calculatorTotal == 8){
liberalSeats = 63
conservativeSeats = 35
ndpSeats = 9
} else if (calculatorTotal ==9){
liberalSeats = 65
conservativeSeats = 33
ndpSeats = 9
} else if (calculatorTotal == 10){
liberalSeats = 67
conservativeSeats = 31
ndpSeats = 9
} else if (calculatorTotal == 11){
liberalSeats = 68
conservativeSeats = 30
ndpSeats = 9
} else if (calculatorTotal == 12){
liberalSeats = 69
conservativeSeats = 29
ndpSeats = 9
} else if (calculatorTotal == 13){
liberalSeats = 70
conservativeSeats = 28
ndpSeats = 9
} else if (calculatorTotal == 14){
liberalSeats = 71
conservativeSeats = 27
ndpSeats = 9
} else if (calculatorTotal == 15){
liberalSeats = 73
conservativeSeats = 25
ndpSeats = 9
} else if (calculatorTotal == -1){
liberalSeats = 42
conservativeSeats = 55
ndpSeats = 10
} else if (calculatorTotal == -2){
liberalSeats = 39
conservativeSeats = 57
ndpSeats = 11
} else if (calculatorTotal == -3){
liberalSeats = 37
conservativeSeats = 59
ndpSeats = 11
} else if (calculatorTotal == -4){
liberalSeats = 35
conservativeSeats = 61
ndpSeats = 11
} else if (calculatorTotal == -5){
liberalSeats = 33
conservativeSeats = 63
ndpSeats = 11
} else if (calculatorTotal == -6){
liberalSeats = 32
conservativeSeats = 64
ndpSeats = 11
} else if (calculatorTotal == -7){
liberalSeats = 31
conservativeSeats = 65
ndpSeats = 11
} else if (calculatorTotal == -8){
liberalSeats = 30
conservativeSeats = 66
ndpSeats = 11
} else if (calculatorTotal == -9){
liberalSeats = 29
conservativeSeats = 67
ndpSeats = 11
} else if (calculatorTotal == -10){
liberalSeats = 28
conservativeSeats = 68
ndpSeats = 11
} else if (calculatorTotal == -11){
liberalSeats = 27
conservativeSeats = 69
ndpSeats = 11
} else if (calculatorTotal == -12){
liberalSeats = 26
conservativeSeats = 70
ndpSeats = 11
} else if (calculatorTotal == -13){
liberalSeats = 24
conservativeSeats = 71
ndpSeats = 12
} else if (calculatorTotal == -14){
liberalSeats = 23
conservativeSeats = 72
ndpSeats = 12
} else if (calculatorTotal == -15){
liberalSeats = 22
conservativeSeats = 73
ndpSeats = 12
};
};

Object Clean-up
Hi everyone:


I'm writing a small animation flash. In it I have a class called ClassStar that extends MovieClip and that is linked with the graphical movie clip of a star in the library. This class provides animation for the star objects. Each of which is created like this from the main time line:

Code:
var star:ClassStar = new ClassStar();
I want to point out that the whole idea of animation is that stars are "pouring out" from a center object and disappear when they fly off the stage.

Now my question. How do you remove the object that was created by the new operator?

So far, I have the following function that varifies if the x and y of a star are within the stage and if not, it removes it off the time line. But what about the class itself. Can I call delete this?

Code:
if(x >= stageWidth || y >= stageHeight)
{
stage.removeChildAt(this.index);
delete this;
}

Clean Up If/else If Statemeents
hi, I remember reading a post a while back that cleaned up else /else if statements with some kind of thing like the php case system.... Im not sure if it was for actionscript 2 but I can use that anyway...

anyone know what it was or how to do it.

Memory Clean Up... HELP PLEASE :)
I have created a simple swf that loads a background image which is about 10 megs in memory. I have a button that is meant to remove the Movie Clip, and delete all references to it.

If I run in Flash Environment, delete myBackGround; returns TRUE.


If I export the SWF and run in flash player, open task manager and watch the VM SIZE, when the images loads it is using about 10 Megs as expected, but when I hit my delete button, the memory is not cleaned up. Why?

I'm confused as to why the memory isn't cleaned up by the GCollector when testing in Flash the delete method returns TRUE to indicate that the clip has been deleted.


Any help is appreciated.

cheers,

tnprivate@hotmail.com

CODE HERE:

Code:
var clip:MovieClip;

start();

function start()
{
clip = attachMovie("picBack", "pickBack_mc", _root.getNextHighestDepth());
//this is the image inside a clip.
}


myButton.onPress = function ()
{

clip.swapDepths(1048575);
clip.removeMovieClip();

var success = delete clip;
trace(success);
}

Clean Up Code?
Hi all,



I have writen a block of code to fades images in and out in a loop and text which fade in and out on top of it.

So image fades in, when at 100, text fades in on top and then fade out, the image fades out. New image fades in and text, and so on.



This all works fine but the code seems quite lengthy, so I wonder if anyone could see a way of shortening the code or making it more readable.






ActionScript Code:
img = [marine_mc, prop_mc, re_mc];
txtImg = [marineTxt_mc, propTxt_mc, reTxt_mc];
// hide images and text to start
for (n=0; n<=img.length; n++) {
 img[n]._alpha = 0;
 txtImg[n]._alpha = 0;
}
var i = 0;
var delay = 2000;//time betweeen images fading
//var txtDelay = ?To alter fading text time.
fadeIn(img[i], 10);
function fadeIn(target, num) {
 target.onEnterFrame = function() {
  target._alpha += num;
  if (target._alpha>=100) {
   target._alpha = 100;
   delete this.onEnterFrame;
   timeDelay = setInterval(out, delay);
   txtIn(txtImg[i], 20);
  }
 };
}
function out() {
 fadeOut(img[i], 10);
}
function txtIn(target, num) {
 target.onEnterFrame = function() {
  target._alpha += num;
  if (target._alpha>=100) {
   target._alpha = 100;
   delete this.onEnterFrame;
   txtOutInt = setInterval(txtFadeOut, (delay/2));
  }
 };
}
function txtFadeOut() {
 txtOut(txtImg[i], 10);
}
function txtOut(target, num) {
 target.onEnterFrame = function() {
  target._alpha -= num;
  if (target._alpha<=0) {
   target._alpha = 0;
   this.onEnterFrame = null;
   clearInterval(txtOutInt);
  }
 };
}
function fadeOut(target, num) {
 target.onEnterFrame = function() {
  target._alpha -= num;
  if (target._alpha<=0) {
   target._alpha = 0;
   this.onEnterFrame = null;
   clearInterval(timeDelay);
   if (i>=img.length-1) {
    i = 0;
   } else {
    i++;
   }
   fadeIn(img[i], 10);
  }
 };
}

CD/ROM Autorun And Clean Up
Two questions:
1. How do I make my cd autorun? I run a mac and I've tried the whole making a text doc called autorun.ini that contains:

[Autorun]
open=Superior-Industries-Media.exe
icon=flashfileicon.ico

(is that right)

2. When I created this Flash application (my first one ever) I saved everything that has to do with it in the same folder. Now the only way I can get the thing to run from a cd is if EVERYTHING from that folder is on the cd. Which creates an eye sore for anyone who is running a mac and has to actually go in and click on the mac projector file for this application. Is there any setting that compresses the whole application and it's files into one? If not, is there an action script that tells flash the path to something? It would have to be attached to what I currently have:

on (release) {
getURL("B-111_TeleStacker.pdf", "_blank");
}

Text Is Not Very Clean Looking
Hi guys

I have searched every where to find a solution to my problem as i once saw how it was done on a thread.

The problem is that text on a flash movie allways looks not very clean (blurry).
How do you clean it up???????????????

can some one help me with this.
Thanks

Clean Up This Code
there HAS got to be a better way to write this out.
Any help would be greatly appreciated. This script will be duplicated
in different MC's containing a different number of "varCheck"s
and different true/false values to check against.


ActionScript Code:
btnSubmit.onRelease = function() {    if (this._parent.varCheck0 && !this._parent.varCheck1 && this._parent.varCheck2 && !this._parent.varCheck3 && this._parent.varCheck4 && this._parent.varCheck5 && !this._parent.varCheck6 && this._parent.varCheck7) {        strHeadline = "Great Job!";        strFeedback = "You got them all right! Let's go on to the next one";        nextFrame();    } else {        strHeadline = "Sorry";        strFeedback = "You got one wrong, let's try this again";        nextFrame();    }};

Clean Images? Jpg Or Png...
Everytime I convert my jpegs or pngs to graphics they get strange edges..yeah in fact they look like crap...whats the best image type to bring into flash (besides vector) for converting to graphics? I'm pretty new at flash.

Clean Up The Code
Hello everyone...

I really need help to clean up this code.....


ActionScript Code:


ActionScript Code:
var curr0._x = d0._x; var curr1._x = d1._x; var curr2._x = d2._x; var curr3._x = d3._x; var curr4._x = d4._x; var curr5._x = d5._x; var curr6._x = d6._x; var curr7._x = d7._x; var curr8._x = d8._x; var curr9._x = d9._x; var curr10._x = d10._x; var curr11._x = d11._x;


so how can I make a loop of this so that I don't have to repeated man times...is it possible...?

tq

Clean Up Code ?
Hi all,

I have writen a block of code to fades images in and out in a loop and text which fade in and out on top of it.
So image fades in, when at 100, text fades in on top and then fade out, the image fades out. New image fades in and text, and so on.

This all works fine but the code seems quite lengthy, so I wonder if anyone could see a way of shortening the code or making it more readable.



ActionScript Code:
img = [marine_mc, prop_mc, re_mc];txtImg = [marineTxt_mc, propTxt_mc, reTxt_mc];// hide images and text to startfor (n=0; n<=img.length; n++) { img[n]._alpha = 0; txtImg[n]._alpha = 0;}var i = 0;var delay = 2000;//time betweeen images fading//var txtDelay = ?To alter fading text time.fadeIn(img[i], 10);function fadeIn(target, num) { target.onEnterFrame = function() {  target._alpha += num;  if (target._alpha>=100) {   target._alpha = 100;   delete this.onEnterFrame;   timeDelay = setInterval(out, delay);   txtIn(txtImg[i], 20);  } };}function out() { fadeOut(img[i], 10);}function txtIn(target, num) { target.onEnterFrame = function() {  target._alpha += num;  if (target._alpha>=100) {   target._alpha = 100;   delete this.onEnterFrame;   txtOutInt = setInterval(txtFadeOut, (delay/2));  } };}function txtFadeOut() { txtOut(txtImg[i], 10);}function txtOut(target, num) { target.onEnterFrame = function() {  target._alpha -= num;  if (target._alpha<=0) {   target._alpha = 0;   this.onEnterFrame = null;   clearInterval(txtOutInt);  } };}function fadeOut(target, num) { target.onEnterFrame = function() {  target._alpha -= num;  if (target._alpha<=0) {   target._alpha = 0;   this.onEnterFrame = null;   clearInterval(timeDelay);   if (i>=img.length-1) {    i = 0;   } else {    i++;   }   fadeIn(img[i], 10);  } };}

How To Clean Up This Code
Howdy folks!

I have an fla that uses the following AS:


PHP Code:



envisionblur._alpha = 100;
envisionblur.onRollOut = function(){
    this.onEnterFrame = function(){
       _root.qt_envision._alpha=0;       
        this._alpha +=10;
        if(this._alpha >= 100){
            this._alpha = 100;
            this.onEnterFrame = null;
        }
    }
}

envisionblur.onRollOver = function(){
    this.onEnterFrame = function(){   
    _root.qt_envision._alpha=100;
        this._alpha -=10;
        if(this._alpha <= 0){
            this._alpha = 0;
            this.onEnterFrame = null;
        }
    }
}

innovateblur._alpha = 100;
innovateblur.onRollOut = function(){
    this.onEnterFrame = function(){
       _root.qt_innovate._alpha=0;
        this._alpha +=10;
        if(this._alpha >= 100){
            this._alpha = 100;
            this.onEnterFrame = null;
        }
    }
}
innovateblur.onRollOver = function(){
    this.onEnterFrame = function(){   
    _root.qt_innovate._alpha=100;
        this._alpha -=10;
        if(this._alpha <= 0){
            this._alpha = 0;
            this.onEnterFrame = null;
        }
    }
}

collaborateblur._alpha = 100;
collaborateblur.onRollOut = function(){
    this.onEnterFrame = function(){
        _root.qt_collaborate._alpha=0;      
        this._alpha +=10;
        if(this._alpha >= 100){
            this._alpha = 100;
            this.onEnterFrame = null;
        }
    }
}
collaborateblur.onRollOver = function(){
    this.onEnterFrame = function(){   
       _root.qt_collaborate._alpha=100;
        this._alpha -=10;
        if(this._alpha <= 0){
            this._alpha = 0;
            this.onEnterFrame = null;
        }
    }
}

performblur._alpha = 100;
performblur.onRollOut = function(){
    this.onEnterFrame = function(){
       _root.qt_perform._alpha=0;
        this._alpha +=10;
        if(this._alpha >= 100){
            this._alpha = 100;
            this.onEnterFrame = null;
        }
    }
}
performblur.onRollOver = function(){
    this.onEnterFrame = function(){   
    _root.qt_perform._alpha=100;
        this._alpha -=10;
        if(this._alpha <= 0){
            this._alpha = 0;
            this.onEnterFrame = null;
        }
    }





Basically, I have four MC's that I want to fade onRollOver and onRollOut. As you can see, writing code for each MC is a rather convoluted way to achieve the effect. Can any of you AS gurus show me how to write the code as a function and apply it to all of the clips?

Thanks!

Can Someone Help Me Clean-up My Code Please?
So I've got my site working, but I KNOW the code is messy and inefficient. I'm very new to programming and haven't learned "proper" coding practices.

I figure there is some way of using a "for loop" to do this more efficiently but I've tried making a for loop a bunch of ways but can't figure out proper syntax and all to do this. I'm sure this is simple for any of you guys but I'm just learning programming now so bare with me.

There are actually 38 loaders but I didn't figure you needed to see them all to help me with this issue. Like I said, everything works, I just know the code is probably REALLY inefficient and it's bothering me.

There has to be a way to use a "for loop" to name and instantiate all of these loaders and movieclips since all the #s correspond. I mean loader1 goes with honeyComb1_mc, etc...I just can't figure out how to do it.


ActionScript Code:
function loadIllustrationThumbs(){    var loader1:Loader = new Loader();    var loader2:Loader = new Loader();    var loader3:Loader = new Loader();    var loader4:Loader = new Loader();    var loader5:Loader = new Loader();    var loader6:Loader = new Loader();    var loader7:Loader = new Loader();    var loader8:Loader = new Loader();    var loader9:Loader = new Loader();    var loader10:Loader = new Loader();    loader1.load(new URLRequest(illusThumbPath + "Nihm_Owl_THUMB.jpg"));    honeyComb1_mc.loader_mc.addChild(loader1);    honeyComb1_mc.addEventListener(MouseEvent.CLICK,loadOwl);    honeyComb1_mc.buttonMode = true;    loader2.load(new URLRequest(illusThumbPath + "Odin_THUMB.jpg"));    honeyComb2_mc.loader_mc.addChild(loader2);    honeyComb2_mc.addEventListener(MouseEvent.CLICK,loadOdin);    honeyComb2_mc.buttonMode = true;    loader3.load(new URLRequest(illusThumbPath + "Egyptian_Thief_THUMB.jpg"));    honeyComb3_mc.loader_mc.addChild(loader3);    honeyComb3_mc.addEventListener(MouseEvent.CLICK,loadEgyptian);    honeyComb3_mc.buttonMode = true;}


Thanks for any help!!

Text Is Not Very Clean Looking
Hi guys

I have searched every where to find a solution to my problem as i once saw how it was done on a thread.

The problem is that text on a flash movie allways looks not very clean (blurry).
How do you clean it up???????????????

can some one help me with this.
Thanks

Clean Up This Code
there HAS got to be a better way to write this out.
Any help would be greatly appreciated. This script will be duplicated
in different MC's containing a different number of "varCheck"s
and different true/false values to check against.


ActionScript Code:
btnSubmit.onRelease = function() {    if (this._parent.varCheck0 && !this._parent.varCheck1 && this._parent.varCheck2 && !this._parent.varCheck3 && this._parent.varCheck4 && this._parent.varCheck5 && !this._parent.varCheck6 && this._parent.varCheck7) {        strHeadline = "Great Job!";        strFeedback = "You got them all right! Let's go on to the next one";        nextFrame();    } else {        strHeadline = "Sorry";        strFeedback = "You got one wrong, let's try this again";        nextFrame();    }};

Clean Images? Jpg Or Png...
Everytime I convert my jpegs or pngs to graphics they get strange edges..yeah in fact they look like crap...whats the best image type to bring into flash (besides vector) for converting to graphics? I'm pretty new at flash.

How To Clean The Memory
my flash presentation is slowing down after about a minute. have a changing gallry that changes randomly and i was a MC as a timer each time it gets to frame five a pic cahanges. i am using createEmptyMovieclip to show the picts from the library on stage. i thought that if i will add removeMovieClip it will
help but ofcourse i was wrang.....
this is my code:
Code:
var j = 136;
var frameNum = 0;
var pic0state = true;
var pic1state = true;
var pic2state = true;
var pic3state = true;
var pic4state = true;
var jNumA0 = null;
var jNumA1 = null;
var jNumA2 = null;
var jNumA3 = null;
var jNumA4 = null;
var jNumB0 = null;
var jNumB1 = null;
var jNumB2 = null;
var jNumB3 = null;
var jNumB4 = null;
function picA0() {
this.createEmptyMovieClip("targetClip0", 1);
targetClip0._x = 22;
targetClip0._y = 13;
i = random(j);
checkFun(i);
this.targetClip0.attachMovie("pic"+i, "pic", 1);
jNumA0 = i;
}
function picA1() {
this.createEmptyMovieClip("targetClip1", 2);
targetClip1._x = 209;
targetClip1._y = 13;
i = random(j);
checkFun(i);
this.targetClip1.attachMovie("pic"+i, "pic", 2);
jNumA1 = i;
}
function picA2() {
this.createEmptyMovieClip("targetClip2", 3);
targetClip2._x = 396;
targetClip2._y = 13;
i = random(j);
checkFun(i);
this.targetClip2.attachMovie("pic"+i, "pic", 3);
jNumA2 = i;
}
function picA3() {
this.createEmptyMovieClip("targetClip3", 4);
targetClip3._x = 584;
targetClip3._y = 13;
i = random(j);
checkFun(i);
this.targetClip3.attachMovie("pic"+i, "pic", 4);
jNumA3 = i;
}
function picA4() {
this.createEmptyMovieClip("targetClip4", 5);
targetClip4._x = 773;
targetClip4._y = 13;
i = random(j);
checkFun(i);
this.targetClip4.attachMovie("pic"+i, "pic", 5);
jNumA4 = i;
}
//
function picB0() {
i = random(j);
this.createEmptyMovieClip("targetClipB0", 6);
targetClipB0._x = 22;
targetClipB0._y = 13;
targetClipB0._alpha = 0;
checkFun(i);
this.targetClipB0.attachMovie("pic"+i, "pic", 6);
jNumB0 = i;
}
//////
function picB1() {
this.createEmptyMovieClip("targetClipB1", 7);
targetClipB1._x = 209;
targetClipB1._y = 13;
targetClipB1._alpha = 0;
i = random(j);
checkFun(i);
this.targetClipB1.attachMovie("pic"+i, "pic", 7);
jNumB1 = i;
}
function picB2() {
this.createEmptyMovieClip("targetClipB2", 8);
targetClipB2._x = 396;
targetClipB2._y = 13;
targetClipB2._alpha = 0;
i = random(j);
checkFun(i);
this.targetClipB2.attachMovie("pic"+i, "pic", 8);
jNumB2 = i;
}
function picB3() {
this.createEmptyMovieClip("targetClipB3", 9);
targetClipB3._x = 584;
targetClipB3._y = 13;
targetClipB3._alpha = 0;
i = random(j);
checkFun(i);
this.targetClipB3.attachMovie("pic"+i, "pic", 9);
jNumB3 = i;
}
function picB4() {
this.createEmptyMovieClip("targetClipB4", 10);
targetClipB4._x = 773;
targetClipB4._y = 13;
targetClipB4._alpha = 0;
i = random(j);
checkFun(i);
this.targetClipB4.attachMovie("pic"+i, "pic", 10);
jNumB4 = i;
}
/////
m = 0;
for (m; m<5; m++) {
_root["picA"+m]();
_root["picB"+m]();
}
///
function fadeOut(param) {
this.onEnterFrame = function() {
if (_root["targetClip"+param]._alpha>0) {
_root["targetClip"+param]._alpha -= 10;
_root["targetClipB"+param]._alpha += 10;
} else {
_root["pic"+param+"state"] = false;
_root["picA"+param]();
this.timer.play();
delete onEnterFrame;
}
};
}
function fadeIn(param) {
this.onEnterFrame = function() {
if (_root["targetClipB"+param]._alpha>0) {
_root["targetClipB"+param]._alpha -= 10;
_root["targetClip"+param]._alpha += 10;
} else {
_root["pic"+param+"state"] = true;
_root["picB"+param]();
this.timer.play();
delete onEnterFrame;
}
};
}
function checkFun(i) {
if (i == jNumA0) {
changeJ();
}
if (i == jNumA1) {
changeJ();
}
if (i == jNumA2) {
changeJ();
}
if (i == jNumA3) {
changeJ();
}
if (i == jNumA4) {
changeJ();
}
if (i == jNumB0) {
changeJ();
}
if (i == jNumB1) {
changeJ();
}
if (i == jNumB2) {
changeJ();
}
if (i == jNumB3) {
changeJ();
}
if (i == jNumB4) {
changeJ();
}
}
function changeJ() {
i = random(136);
checkFun(i);
}
and my timer has this on frame 5:

Code:
i = random(5);
if (_parent.frameNum == i) {
if (i>3) {
_parent.frameNum = i-1;
i = _parent.frameNum;
} else {
_parent.frameNum = i+1;
i = _parent.frameNum;
}
} else {
_parent.frameNum = i;
}
////
if (_root["pic"+i+"state"] == true) {
_parent.fadeOut(i);
} else {
_parent.fadeIn(i);
}
stop();

A Question On Clean Up
Hey out there;

With your help, I've pretty much solved (or accepted defeat) most of the tech issues that were popping up in what I'm making. Now i have "finishing off" questions. Here's one on clean up: when i look at the timeline, there are places where there might be empty frames (say after a fade out) that don't need to be there, and can be deleted. And when i look in the library, they're are lingering bitmaps that were never used, old tweens... junk.

Do i need to take this crap out? Should i do so to reduce movie size? Or when i publish, is it all ground to dust; a non-issue?

As always, thanks
Hoss

A Clean Trace
Hi everyone,
Was wondering if anyone out there could help me on creating a clean trace by using freehand, say, an outline of a car. Basically, the effect that I am trying to achieve is in here .
specifically, in section 4 > Publish > release to layers...
When i used freehand, i had difficulty in setting the trace tool to get the clean trace...


Any advise would be greatly appreciated...
thanks.

Clean Photo's
Here's my question, check out http://www.bleedingstarclothing.com/main.html

Go to the "clothing" section. You'll notice an interesting little menu with a guy in some cloths. I was wonder how the jpeg or photo graph was animated so cleanly. I've noticed this on other sites as well. Photographs being animated with high resolution and cut out. If someone could help it would be appreciated.

Clean Up My Code
Hi guys...could someone please help me clean up this code, I know this can be done with a lot fewer lines of code. I'm trying to go through all my code at the moment, and i think the answer to this will help me with everything else.

thanks in advance

Bongo


ActionScript Code:
if(_root.polaroidwork1.polaroidmain.picture_mc._width == 247 && smooth1 == true) {
        var namevar = _root.polaroidwork1.polaroidmain.picture_mc;
        var myBitmap = new BitmapData(namevar._width, namevar._height, true);
        myBitmap.draw(namevar);
        removeMovieClip(namevar);
        _root.polaroidwork1.polaroidmain.createEmptyMovieClip("picture_mc",4);
        _root.polaroidwork1.polaroidmain.picture_mc._x = 18.9;
        _root.polaroidwork1.polaroidmain.picture_mc._y = 23.4;
        namevar.attachBitmap(myBitmap, 1, "auto", true);
        smooth1 = false;
    }
    if(_root.polaroidwork2.polaroidmain.picture_mc._width == 247 && smooth2 == true) {
        var namevar = _root.polaroidwork2.polaroidmain.picture_mc;
        var myBitmap = new BitmapData(namevar._width, namevar._height, true);
        myBitmap.draw(namevar);
        removeMovieClip(namevar);
        _root.polaroidwork2.polaroidmain.createEmptyMovieClip("picture_mc",4);
        _root.polaroidwork2.polaroidmain.picture_mc._x = 18.9;
        _root.polaroidwork2.polaroidmain.picture_mc._y = 23.4;
        namevar.attachBitmap(myBitmap, 1, "auto", true);
        smooth2 = false;
    }
    if(_root.polaroidwork3.polaroidmain.picture_mc._width == 247 && smooth3 == true) {
        var namevar = _root.polaroidwork3.polaroidmain.picture_mc;
        var myBitmap = new BitmapData(namevar._width, namevar._height, true);
        myBitmap.draw(namevar);
        removeMovieClip(namevar);
        _root.polaroidwork3.polaroidmain.createEmptyMovieClip("picture_mc",4);
        _root.polaroidwork3.polaroidmain.picture_mc._x = 18.9;
        _root.polaroidwork3.polaroidmain.picture_mc._y = 23.4;
        namevar.attachBitmap(myBitmap, 1, "auto", true);
        smooth3 = false;
    }
    if(_root.polaroidwork4.polaroidmain.picture_mc._width == 247 && smooth4 == true) {
        var namevar = _root.polaroidwork4.polaroidmain.picture_mc;
        var myBitmap = new BitmapData(namevar._width, namevar._height, true);
        myBitmap.draw(namevar);
        removeMovieClip(namevar);
        _root.polaroidwork4.polaroidmain.createEmptyMovieClip("picture_mc",4);
        _root.polaroidwork4.polaroidmain.picture_mc._x = 18.9;
        _root.polaroidwork4.polaroidmain.picture_mc._y = 23.4;
        namevar.attachBitmap(myBitmap, 1, "auto", true);
        smooth4 = false;
    }
    if(_root.polaroidwork5.polaroidmain.picture_mc._width == 247 && smooth5 == true) {
        var namevar = _root.polaroidwork5.polaroidmain.picture_mc;
        var myBitmap = new BitmapData(namevar._width, namevar._height, true);
        myBitmap.draw(namevar);
        removeMovieClip(namevar);
        _root.polaroidwork5.polaroidmain.createEmptyMovieClip("picture_mc",4);
        _root.polaroidwork5.polaroidmain.picture_mc._x = 18.9;
        _root.polaroidwork5.polaroidmain.picture_mc._y = 23.4;
        namevar.attachBitmap(myBitmap, 1, "auto", true);
        smooth5 = false;
    }

Clean Up Code
can anyone think of a way I could clean up/make code tighter??

http://www.geocities.com/zenonives/index.html

it just feels like it could be more efficient but don't really know how are why

cheers

Z

Clean Loader
Wow. my 3rd or 4th thread straight bout loaders
k saw this site http://dan.inko.ca/findex.htm and was curious to how they made the loader slide bigger.

Is It Possible To Clean This Code Up?
Code:

Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.showMenu = false;

var stageW:Object = Stage.width;
var stageH:Object = Stage.height;
var stageHalfW:Object = stageW/2;
var stageHalfY:Object = stageH/2;

var level = this;

stop();

var myMCL:MovieClipLoader = new MovieClipLoader();
var MCLlisten:Object = new Object();
myMCL.addListener(MCLlisten);

_level50._visible = false;
_level50.bar._x = 0;
_level50.percent._y = 0;
_level50.percent._x = 0;


MCLlisten.onLoadStart = function(targetMC) {
   _level50._visible = true;
   _level50._visible = true;
};

MCLlisten.onLoadProgress = function(targetMC, lBytes, tBytes) {
   _level50._visible = true;
   _level50.bar._width = (lBytes/tBytes) * stageW;
   _level50.bar._y = 0;
   _level50.bar._height = stageH;
   _level50.percent._x = (lBytes/tBytes) * stageW - 35;
   _level50.percent._y = stageHalfY;
   _level50.percent.percent.text = Math.round((lBytes/tBytes)*100);
};

MCLlisten.onLoadComplete = function(targetMC) {
   _level50._visible = false;
}

myMCL.loadClip("trigger.swf", 5);
myMCL.loadClip("preloader.swf", 50);
_level50._visible = false;
level.attachMovie("loadingLib","loadingLib", this.getNextHighestDepth());
loadingLib._x = stageHalfW;
loadingLib._y = stageHalfY;

All this _level50 rubbish is really irritating me.... Also for some reason my preloader is not not setting itself to the size of the stage :( any idea's why?

Help To Clean Up The AS2 Code
Hello. Can someone help me to clean up the code. I am still learning ActionScript 2 and I got this AS with Decomplier. SO for information I didn`t make this code at all. I just wanna understand there what is going on.
The problem is I want to change instance name of mc "archives_thum1" to "menu". I changet myself in this code and mc instance name. But it didn`t work.
Here is the example
Code:

this._parent.startMain();
var max_width = new Array(10, 30, 10, 30, 10, 10, 30, 10, 30, 10);
var min_width = new Array(-3, 0, -3, 0, -2, 0, -1, 0, -2, -3);
var myRatio = new Array(8.000000E-002, 6.000000E-002, 9.000000E-002, 6.000000E-002, 1.000000E-001, 8.000000E-002, 6.000000E-002, 8.000000E-002, 1.000000E-001, 6.000000E-002);
var myRatio1 = new Array(3.200000E-001, 3.400000E-001, 2.800000E-001, 3.200000E-001, 3.300000E-001, 4.200000E-001, 4.400000E-001, 3.200000E-001, 3.800000E-001, 4.400000E-001);
var out_x = new Array(-200, 1200, -200, 1200, -200, 1200, -200, 1200, -200, 1200);
for (i = 1; i <= 10; i++)
{
    this["ratio_x" + i] = (max_width[i - 1] - min_width[i - 1]) / max_width[i - 1];
    this["archives_thum1"].start_x = this["archives_thum1"]._x;
   this["archives_thum1"].onRollOver = function ()
    {
        this.gotoAndStop(2);
    };
    this["archives_thum1"].onRollOut = function ()
    {
        this.gotoAndStop(1);
    };

};

slideThum = function ()
{
    for (i = 1; i <= 10; i++)
    {
        this["archives_thum1"].onEnterFrame = function ()
        {
            var menu = this._name.substring(13);
            this.trg_x = (_xmouse) / 2.400000E+000 * this._parent["ratio_x" + menu];
            this._x = this._x + (-this.trg_x - this._x + max_width[menu - 1] + this.start_x) * myRatio[menu - 1];
        };
    }
};

fadeIn = function ()
{
    for (i = 1; i <= 10; i++)
    {
        this["archives_thum1"]._x = out_x[i - 1];
        this["archives_thum1"].onEnterFrame = function ()
        {
            var menu = this._name.substring(13);
            this.trg = this.start_x;
            this.speed = (this.trg - this._x) * myRatio1[menu - 1];
            this._x = this._x + this.speed;
            if (Math.abs(this.speed) < 1.000000E-001)
            {
                delete this.onEnterFrame;
                if (menu == 1)
                {
                    slideThum();
                }
            }
        };
    }
};
fadeIn();

Thanks :P

Clean Up Library Clutter
Just wondering if there's a way to see how many objects in my movie are using items in the library. I think I have extra junk in the library that I don't need, but I would like to make sure it's not being used anywhere. I know I could check by looking at the movie, but it's a big intricate project and I can't chance anything. Thanks a lot!

*Fresh* And So Clean (Newbie)
Hey everyone, just wanted somebody to tell me the soulution to the following problem;

http://www.zenoarts.homestead.com

just strated that site and the squares are mc's that fade colors. The only problem is if you go over them too fast they simply light up, even though I have the onRollout effec. Could anyone help? Thanks.

(One more thing, how do you install the downloaded fonts?)

Futuristic, Clean And Professional...anyone?
I know this is probably the wrong place to post this but I'm looking for inspiration to design a business card for a web-developing business. I want to come up with something futuristic, yet clean and professional. Seen anything like that that can give me some inspiration.

thanks in advance

Mastercraft.com Clean Text
So does anyone know how Mastercraft was able to keep the text so clean on this flash site?

http://www.mastercraft.com/main.asp

What font is that? Thanks!

How Do You Import Clean Graphics
If you look at a site like www.derbauer.de and notice that the interface graphics look like they were produced in photoshop with the metal look etc.

How do they import these into Flash and retain the crystal clarity of the graphic?. You can really see every detail of their interface.

I've imported bitmaps, png files, jpgs into flash and the end result is that none of them look as sharp as the photoshop file. They always seem like in Flash they are not as clear as the original.

Clean Workflows For Series
Hello... been using flash for a couple of weeks and I am keen to start animating a series of one minute episodes.

Being a series... I will need good clean workflow to handle all of this.

I will be exporting to swf and avi.

I have already done several tests to work out how to set up cameras and easy scale scene for different pixel size exports.

I was wondering though if anyone has any good tips, links that suguesst good workflows in reguards to... anything.
eg
-templates of backgrounds and characters.
-re using animations.
-etc etc etc.
Please note I am not after animation tips.

Any articles about how they make flash cartoons for TV would also be good.

Thanx peoples.

Clean Logo Imports (EPS)
I'm kind of a newbie with some stuff....like this. I have the logo of a company that is in EPS format...CMYK. I'm using PhotoSHop 7 on a new Mac. I save the logo as a PNG so I can retain the transparent elements of the logo so I can put it over photos already in the fla. But when I place the file into flash, it is too choppy...the lines of the logo are all ugly and unsmooth. Can someone PLEASE help me! I know this is fundamental, but I NEED to know how to do it. Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved