Optimizing .swfs
Hi Guys, I just built a game in Flash. It’s embedded in an html page that tells it to display at 120%. The problem I’m having is that some people on PC and MACS are playing the game and it’s running slow. Is there a way to optimize the game? Is it because it’s set to be 120% percent larger? The game is built with all vector art, and only 2 small sounds. The file is about 200k. Do older computers just have a problem viewing Flash games? Thanks in advance!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Optimizing & Compressing SWFs
I'm creating a banner advert for an exchange and have finished it. The advertising company say that it needs to be Flash 5 and no more than 13k. It weighs in at a "massive" 20kb unfortunately when compiled for Flash 5. When I compile it for Flash 6, the size goes right down to 11kb!
I know that I can't change the minimum version of Flash but has anyone got any good tips on how to compress the file? All graphics are vectors so it's not even bitmaps or JPGS taking up space. And there is no sound.
Any suggestions are welcome!!
Optimizing?
How can I optimize my movie, it is 500kbs and all it is is just 5 different text items with a picture that pop up. It is an ad for a concert. But it does have an entire song.
Optimizing A Little?
Wondering if anybody can give me any tips to optimise this:
Code:
createEmptyMovieClip("MaskedButton", 400);
MaskedButton.createEmptyMovieClip("FadingText", 400);
MaskedButton.createEmptyMovieClip("MovingText", 500);
MaskedButton.createEmptyMovieClip("ClickedText", 600);
//
createEmptyMovieClip("OuterBevels", 0);
if (BtnNum == 0) {
OuterBevels.attachMovie("BevelFarLeft", "panelLeft", 300);
} else {
OuterBevels.attachMovie("BevelLeft", "panelLeft", 300);
}
OuterBevels.attachMovie("BevelRight", "panelRight", 200);
OuterBevels.attachMovie("BevelCenter", "panelCenter", 100);
//
MaskedButton.createEmptyMovieClip("Fader", 100);
if (BtnNum == 0) {
MaskedButton.Fader.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
MaskedButton.Fader.attachMovie("LeftInterior", "panelLeft", 300);
}
MaskedButton.Fader.attachMovie("RightInterior", "panelRight", 200);
MaskedButton.Fader.attachMovie("CenterInterior", "panelCenter", 100);
//
MaskedButton.createEmptyMovieClip("ButtonOnShadow", 200);
if (BtnNum == 0) {
MaskedButton.ButtonOnShadow.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
MaskedButton.ButtonOnShadow.attachMovie("LeftInterior", "panelLeft", 300);
}
MaskedButton.ButtonOnShadow.attachMovie("RightInterior", "panelRight", 200);
MaskedButton.ButtonOnShadow.attachMovie("CenterInterior", "panelCenter", 100);
//
MaskedButton.createEmptyMovieClip("ButtonOn", 300);
if (BtnNum == 0) {
MaskedButton.ButtonOn.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
MaskedButton.ButtonOn.attachMovie("LeftInterior", "panelLeft", 300);
}
MaskedButton.ButtonOn.attachMovie("RightInterior", "panelRight", 200);
MaskedButton.ButtonOn.attachMovie("CenterInterior", "panelCenter", 100);
//
createEmptyMovieClip("Mask", 500);
if (BtnNum == 0) {
Mask.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
Mask.attachMovie("LeftInterior", "panelLeft", 300);
}
Mask.attachMovie("RightInterior", "panelRight", 200);
Mask.attachMovie("CenterInterior", "panelCenter", 100);
//
//==============================================================================================//
//Create the Main Button Textfields
//==============================================================================================//
var MBFT = MaskedButton.FadingText;
var MBMT = MaskedButton.MovingText;
var MBF = MaskedButton.Fader;
var M = Mask;
var MBBO = MaskedButton.ButtonOn;
var MBBOS = MaskedButton.ButtonOnShadow;
var OB = OuterBevels;
var MB = MaskedButton;
var NameVarPos = "_parent._parent.BtnName";
BuildClips = [MBF, M, MBBO, MBBOS, OB];
//
MBBOS.setTint(64, 47, 21, 100);
MBBO._x = 2;
MBBO._y = 2;
MBBO.setTint(138, 108, 47, 100);
MB.setMask(Mask);
useHandCursor = false;
//
MBFT.createTextField("FadingTxtShd_txt", 7, 6, 7, 0, 0);
MBFT.FadingTxtShd_txt.type = "Dynamic";
MBFT.FadingTxtShd_txt.autoSize = "left";
MBFT.FadingTxtShd_txt.variable = NameVarPos;
MBFT.FadingTxtShd_txt.selectable = false;
MBFT.FadingTxtShd_txt.setTextFormat(BtnShdOvr_fmt);
MBFT.FadingTxtShd_txt.embedFonts = true;
//
MBFT.createTextField("FadingTxt_txt", 8, 5, 6, 0, 0);
MBFT.FadingTxt_txt.type = "Dynamic";
MBFT.FadingTxt_txt.autoSize = "left";
MBFT.FadingTxt_txt.variable = NameVarPos;
MBFT.FadingTxt_txt.selectable = false;
MBFT.FadingTxt_txt.setTextFormat(BtnTxtOvr_fmt);
MBFT.FadingTxt_txt.embedFonts = true;
//
MBMT.createTextField("MovingTxtShd_txt", 9, 6, 8, 0, 0);
MBMT.MovingTxtShd_txt.type = "Dynamic";
MBMT.MovingTxtShd_txt.autoSize = "left";
MBMT.MovingTxtShd_txt.variable = NameVarPos;
MBMT.MovingTxtShd_txt.selectable = false;
MBMT.MovingTxtShd_txt.setTextFormat(BtnShd_fmt);
MBMT.MovingTxtShd_txt.embedFonts = true;
//
MBMT.createTextField("MovingTxt_txt", 10, 5, 6, 0, 0);
MBMT.MovingTxt_txt.type = "Dynamic";
MBMT.MovingTxt_txt.autoSize = "left";
MBMT.MovingTxt_txt.variable = NameVarPos;
MBMT.MovingTxt_txt.selectable = false;
MBMT.MovingTxt_txt.setTextFormat(BtnTxt_fmt);
MBMT.MovingTxt_txt.embedFonts = true;
//
//==============================================================================================//
// Dynamically builds the backgrounds for the button
//==============================================================================================//
var PanelWidth = Math.round(MBMT._width);
var HalfPanel = PanelWidth/2;
var LeftPanelPos = 0;
var MiddlePanelPos = HalfPanel;
var RightPanelPos = LeftPanelPos+PanelWidth;
//
for (i=0; i<Number(BuildClips.length); i++) {
BuildClips[i].panelCenter._width = PanelWidth;
BuildClips[i].panelCenter._x = MiddlePanelPos;
BuildClips[i].panelLeft._x = LeftPanelPos;
BuildClips[i].panelRight._x = RightPanelPos;
if (BuildClips[i] == OB) {
BuildClips[i].panelCenter._width = PanelWidth+2;
}
}
//==============================================================================================//
// Place Button
//==============================================================================================//
var PrevBtnNum = BtnNum-1;
var BtnPos = _parent["button"+PrevBtnNum]._x+_parent["button"+PrevBtnNum]._width;
if (BtnNum == 0) {
_parent["button"+BtnNum]._x = FirstBtnIndent;
} else {
_parent["button"+BtnNum]._x = BtnPos;
}
//
//==============================================================================================//
// New Area
//==============================================================================================//
// define Tween instances
BtnFade_twn = new Tween(MaskedButton.Fader, "_alpha", Math.easeOutCubic, FadeMin, FadeMax, FadeDurationIn);
BtnFade_twn.stop();
//
MovingTxt_twn = new Tween(MaskedButton.MovingText, "_y", Math.easeOutCubic, MoveMin, MoveMax, MoveDurationIn);
MovingTxt_twn.stop();
//
TextFade_twn = new Tween(MaskedButton.FadingText, "_alpha", Math.easeOutCubic, TextFadeMin, TextFadeMax, TextFadeDurationIn);
TextFade_twn.stop();
//
ButtonOn_twn = new Tween(MaskedButton.ButtonOn, "_alpha", Math.easeOutCubic, ButtonPressMin, ButtonPressMax, ButtonPressDurationIn);
ButtonOn_twn.stop();
//
ButtonOnShadow_twn = new Tween(MaskedButton.ButtonOnShadow, "_alpha", Math.easeOutCubic, ButtonPressMin, ButtonPressMax, ButtonPressDurationIn);
ButtonOnShadow_twn.stop();
//
ButtonOnTextShadow_twn = new Tween(MaskedButton.ButtonOnTextShadow, "_alpha", Math.easeOutCubic, ButtonPressMin, ButtonPressMax, ButtonPressDurationIn);
ButtonOnShadow_twn.stop();
// Button Clicked
ButtonClicked = function () {
for (i=0; i<Number(_parent.menuItems_arr.length); i++) {
_parent["button"+i].MBMT.MovingTxtShd_txt.setTextFormat(BtnShd_fmt);
_parent["button"+i].buttonon_twn.continueTo(FadeMin);
_parent["button"+i].buttononshadow_twn.continueTo(FadeMin);
_parent["button"+i].buttonontextshadow_twn.continueTo(FadeMin);
_parent["button"+i].fadeOut();
_parent["button"+i].enabled = true;
}
ButtonOn_twn.continueTo(FadeMax);
ButtonOnShadow_twn.continueTo(FadeMax);
ButtonOnTextShadow_twn.continueTo(FadeMax);
MBMT.MovingTxtShd_txt.setTextFormat(BtnClkTxtShd_fmt);
// getURL(this.ContentURL, Frm);
enabled = false;
setSection(Menu);
};
//Send message to Left Menu to change
setSection = function (Menu) {
trace("message variable is "+Menu);
var my_lc = new LocalConnection();
my_lc.send("incoming", "GetMenuArea", Menu);
delete my_lc;
};
//Fade me in
fadeIn = function () {
BtnFade_twn.continueTo(FadeMax);
MovingTxt_twn.continueTo(MoveMax);
TextFade_twn.continueTo(FadeMax);
};
// Fade me out
fadeOut = function () {
BtnFade_twn.continueTo(FadeMin);
MovingTxt_twn.continueTo(MoveMin);
TextFade_twn.continueTo(FadeMin);
};
//
// Start fadeIn onRollOver
onRollOver = function () {
fadeIn();
};
// Start fadeOut onRollOut
onRollOut = function () {
fadeOut();
};
onPress = function () {
ButtonClicked();
};
It is a button that has some tweening animation in it but seems to come to a bit of a crawl when there is another swf of the page that it is connected to with a local connection. there are six of the running across the top menu panel in close succession.
Optimizing
Where can I find info on optimizing?
i have a intro thats 5sec. long and takes 1min to load. wtf!
its full of screen shots and the total file size is 471kb.
i think i was sucessful when i converted the .bmp screen shots to vectors. is their away to tell besides the file size?
Optimizing Swf's Please Help
My site has grown a lil too large, or so it seems, its a little less than 2 MB's and i have found programs to let me lower the size, but i cannot get the animations to run a smooth as they do on my computer. i have 3 GB's of memory, and they help when it comes to doing so much flash, photoshop, soundforge, etc, all at the same time, but it has also prooven to be a huge problem when it comes to seeing how well the animations work on other computers.
for instance, when i play it on my computer, it looks great, all the anims exactly how they are suppose to be, however, when i play them on my other pc (256 MB) the animations are way too slow.
i know that there are many ways to fix issues like this, but i dont know many. i have tried using Flash Optimizer's demo, and can get the file to a very small size, but it still wont look right.
Please help me, as i really would like to resolve this issue before i continue with my site.
Mantis
Please Help ='[, Optimizing Your AS?
Hi this is my game and I've now encountered a problem when playing my game off the internet. Usually when there is more than one enemy (Square, Circle, Triangle) there is a significant drop in FPS.
Heres my game: http://img90.imageshack.us/my.php?im....swf&width=800
800x600 is its native size
Heres the enemy code:
PHP Code:
onClipEvent (load) {
///Lives
lives = 2;
///Counter
counter = 0;
///Speed Variables
speed_x = 0;
speed_y = 0;
///Acc Variables
acc_x = 0.6;
acc_y = 0.6;
///Dec Variables
dec_x = 0.94;
dec_y = 0.94;
i = 1;
///AI Smartness
smart = 120;
smart_speed = 0.8;
///Colour Random
arr = [0xFF0000,0xFF6600,0xFFFF00,0x0066FF,0x00FF00];
num = random(arr.length);
col = new Color(this);
col.setRGB(arr[num]);
}
onClipEvent (enterFrame) {
///AI Angles
if(_global.ai == 1){
xd = _root.user._x-this._parent._x;
yd = _root.user._y-this._parent._y;
ang = Math.atan2(yd, xd);
enemy_ang = ang*(180/math.PI);
}
///Rotation
this._parent._rotation = enemy_ang;
///Respawn
if (this._parent._name == "target_smart") {
}else{
if (this._parent._x>820) {
this._parent._x = -20;
}
if (this._parent._x<-20) {
this._parent._x = 820;
}
if (this._parent._y>620) {
this._parent._y = -20;
}
if (this._parent._y<-20) {
this._parent._y = 620;
}
///Move Target
this._parent._x += speed_x;
this._parent._y += speed_y;
}
///Increase Speed
if(_global.ai == 1){
///Move Up
if (_global.player_y<this._parent._y and avoid == 0) {
speed_y -= acc_y;
}
///Move Down
if (_global.player_y>this._parent._y and avoid == 0) {
speed_y += acc_y;
}
///Move Right
if (_global.player_x<this._parent._x and avoid == 0) {
speed_x -= acc_x;
}
///Move Left
if (_global.player_x>this._parent._x and avoid == 0) {
speed_x += acc_x;
}
}
///Decrease Speed
speed_y *= dec_y;
speed_x *= dec_x;
///User Death
if(_global.god == 0){
if(this._parent.hitTest(_root.user.user_art)){
_global.lives -= 1;
_global.reset = 1;
_global.god = 1;
///Boom Sound
_root.boom.start();
}
}
///Shot hitTest
for (i=0; i<=_root.shotcount; i++) {
bullety_dis = this._parent._y-eval("_root.shot"+i)._y;
bulletx_dis = this._parent._x-eval("_root.shot"+i)._x;
if(_global.ai == 1){
///Avoid Bullet, UP
if (bullety_dis>-smart and bullety_dis<0) {
speed_y -= smart_speed;
avoid = 1;
}
///Avoid Bullet, DOWN
if (bullety_dis<smart and bullety_dis>0) {
speed_y += smart_speed;
avoid = 1;
}
///Avoid Bullet, LEFT
if (bulletx_dis<-smart and bulletx_dis<0) {
speed_x -= smart_speed;
avoid = 1;
}
///Avoid Bullet, RIGHT
if (bulletx_dis<smart and bulletx_dis>0) {
speed_x += smart_speed;
avoid = 1;
}
avoid = 0;
}
///Bullet Hit
if (eval("_root.shot"+i).hitTest(this._parent)) {
lives -= 1;
if(lives == 0){
///Kill Meter
_global.kills += 1;
///Bite Explosion
_root.attachMovie("bubble", "bubble_"+x, 500, {_x:this._parent._x, _y:this._parent._y});
///Target Delete
this._parent.unloadMovie();
///Score Addtion
_global.score += 20;
}
///Shot Delete
eval("_root.shot"+i)._x = -100;
eval("_root.shot"+i)._y = -100;
///Boom Sound
_root.boom.start();
}
}
}
So could you help me find the problem with the enemies code and help the game to run faster. And I will be putting you in the Special Thanks if you help me over come this problem
Please Help
Optimizing CPU Use
I want to make my little flash project a little faster, and I have a question - is it better to have just one onClipEvent(enterframe) rather than several? or does it not matter?
Also, have any tips on CPU traps? (I'm talking about things that use the CPU too much..)
thanks
Optimizing An Swf
greetings
i have a small question, is it possible to compress an swf like say one that it 5mb to about 2mb ????
Optimizing AS
Can anybody help me optimize a website not for the space that it occupies but for the ram it uses and how jerky it runs? I do not know why it does that. There aren't so many movies just a lot of effects. If anybody could help me please tell me and i will post the fla.
Optimizing XML
I was wondering if anyone has a link to a guide or something on how to optimize my XML to increase it's load speed.
I am using XML to load articles onto stage. Now they load, but one article in particular takes over 20 seconds when I test it on my machine which leads me to believe that is flash player that is choking.
So if anyone has any insight on how to fix a problem like this that would be great.
Optimizing A Little?
Wondering if anybody can give me any tips to optimise this:
Code:
createEmptyMovieClip("MaskedButton", 400);
MaskedButton.createEmptyMovieClip("FadingText", 400);
MaskedButton.createEmptyMovieClip("MovingText", 500);
MaskedButton.createEmptyMovieClip("ClickedText", 600);
//
createEmptyMovieClip("OuterBevels", 0);
if (BtnNum == 0) {
OuterBevels.attachMovie("BevelFarLeft", "panelLeft", 300);
} else {
OuterBevels.attachMovie("BevelLeft", "panelLeft", 300);
}
OuterBevels.attachMovie("BevelRight", "panelRight", 200);
OuterBevels.attachMovie("BevelCenter", "panelCenter", 100);
//
MaskedButton.createEmptyMovieClip("Fader", 100);
if (BtnNum == 0) {
MaskedButton.Fader.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
MaskedButton.Fader.attachMovie("LeftInterior", "panelLeft", 300);
}
MaskedButton.Fader.attachMovie("RightInterior", "panelRight", 200);
MaskedButton.Fader.attachMovie("CenterInterior", "panelCenter", 100);
//
MaskedButton.createEmptyMovieClip("ButtonOnShadow", 200);
if (BtnNum == 0) {
MaskedButton.ButtonOnShadow.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
MaskedButton.ButtonOnShadow.attachMovie("LeftInterior", "panelLeft", 300);
}
MaskedButton.ButtonOnShadow.attachMovie("RightInterior", "panelRight", 200);
MaskedButton.ButtonOnShadow.attachMovie("CenterInterior", "panelCenter", 100);
//
MaskedButton.createEmptyMovieClip("ButtonOn", 300);
if (BtnNum == 0) {
MaskedButton.ButtonOn.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
MaskedButton.ButtonOn.attachMovie("LeftInterior", "panelLeft", 300);
}
MaskedButton.ButtonOn.attachMovie("RightInterior", "panelRight", 200);
MaskedButton.ButtonOn.attachMovie("CenterInterior", "panelCenter", 100);
//
createEmptyMovieClip("Mask", 500);
if (BtnNum == 0) {
Mask.attachMovie("LeftFarInterior", "panelLeft", 300);
} else {
Mask.attachMovie("LeftInterior", "panelLeft", 300);
}
Mask.attachMovie("RightInterior", "panelRight", 200);
Mask.attachMovie("CenterInterior", "panelCenter", 100);
//
//==============================================================================================//
//Create the Main Button Textfields
//==============================================================================================//
var MBFT = MaskedButton.FadingText;
var MBMT = MaskedButton.MovingText;
var MBF = MaskedButton.Fader;
var M = Mask;
var MBBO = MaskedButton.ButtonOn;
var MBBOS = MaskedButton.ButtonOnShadow;
var OB = OuterBevels;
var MB = MaskedButton;
var NameVarPos = "_parent._parent.BtnName";
BuildClips = [MBF, M, MBBO, MBBOS, OB];
//
MBBOS.setTint(64, 47, 21, 100);
MBBO._x = 2;
MBBO._y = 2;
MBBO.setTint(138, 108, 47, 100);
MB.setMask(Mask);
useHandCursor = false;
//
MBFT.createTextField("FadingTxtShd_txt", 7, 6, 7, 0, 0);
MBFT.FadingTxtShd_txt.type = "Dynamic";
MBFT.FadingTxtShd_txt.autoSize = "left";
MBFT.FadingTxtShd_txt.variable = NameVarPos;
MBFT.FadingTxtShd_txt.selectable = false;
MBFT.FadingTxtShd_txt.setTextFormat(BtnShdOvr_fmt);
MBFT.FadingTxtShd_txt.embedFonts = true;
//
MBFT.createTextField("FadingTxt_txt", 8, 5, 6, 0, 0);
MBFT.FadingTxt_txt.type = "Dynamic";
MBFT.FadingTxt_txt.autoSize = "left";
MBFT.FadingTxt_txt.variable = NameVarPos;
MBFT.FadingTxt_txt.selectable = false;
MBFT.FadingTxt_txt.setTextFormat(BtnTxtOvr_fmt);
MBFT.FadingTxt_txt.embedFonts = true;
//
MBMT.createTextField("MovingTxtShd_txt", 9, 6, 8, 0, 0);
MBMT.MovingTxtShd_txt.type = "Dynamic";
MBMT.MovingTxtShd_txt.autoSize = "left";
MBMT.MovingTxtShd_txt.variable = NameVarPos;
MBMT.MovingTxtShd_txt.selectable = false;
MBMT.MovingTxtShd_txt.setTextFormat(BtnShd_fmt);
MBMT.MovingTxtShd_txt.embedFonts = true;
//
MBMT.createTextField("MovingTxt_txt", 10, 5, 6, 0, 0);
MBMT.MovingTxt_txt.type = "Dynamic";
MBMT.MovingTxt_txt.autoSize = "left";
MBMT.MovingTxt_txt.variable = NameVarPos;
MBMT.MovingTxt_txt.selectable = false;
MBMT.MovingTxt_txt.setTextFormat(BtnTxt_fmt);
MBMT.MovingTxt_txt.embedFonts = true;
//
//==============================================================================================//
// Dynamically builds the backgrounds for the button
//==============================================================================================//
var PanelWidth = Math.round(MBMT._width);
var HalfPanel = PanelWidth/2;
var LeftPanelPos = 0;
var MiddlePanelPos = HalfPanel;
var RightPanelPos = LeftPanelPos+PanelWidth;
//
for (i=0; i<Number(BuildClips.length); i++) {
BuildClips[i].panelCenter._width = PanelWidth;
BuildClips[i].panelCenter._x = MiddlePanelPos;
BuildClips[i].panelLeft._x = LeftPanelPos;
BuildClips[i].panelRight._x = RightPanelPos;
if (BuildClips[i] == OB) {
BuildClips[i].panelCenter._width = PanelWidth+2;
}
}
//==============================================================================================//
// Place Button
//==============================================================================================//
var PrevBtnNum = BtnNum-1;
var BtnPos = _parent["button"+PrevBtnNum]._x+_parent["button"+PrevBtnNum]._width;
if (BtnNum == 0) {
_parent["button"+BtnNum]._x = FirstBtnIndent;
} else {
_parent["button"+BtnNum]._x = BtnPos;
}
//
//==============================================================================================//
// New Area
//==============================================================================================//
// define Tween instances
BtnFade_twn = new Tween(MaskedButton.Fader, "_alpha", Math.easeOutCubic, FadeMin, FadeMax, FadeDurationIn);
BtnFade_twn.stop();
//
MovingTxt_twn = new Tween(MaskedButton.MovingText, "_y", Math.easeOutCubic, MoveMin, MoveMax, MoveDurationIn);
MovingTxt_twn.stop();
//
TextFade_twn = new Tween(MaskedButton.FadingText, "_alpha", Math.easeOutCubic, TextFadeMin, TextFadeMax, TextFadeDurationIn);
TextFade_twn.stop();
//
ButtonOn_twn = new Tween(MaskedButton.ButtonOn, "_alpha", Math.easeOutCubic, ButtonPressMin, ButtonPressMax, ButtonPressDurationIn);
ButtonOn_twn.stop();
//
ButtonOnShadow_twn = new Tween(MaskedButton.ButtonOnShadow, "_alpha", Math.easeOutCubic, ButtonPressMin, ButtonPressMax, ButtonPressDurationIn);
ButtonOnShadow_twn.stop();
//
ButtonOnTextShadow_twn = new Tween(MaskedButton.ButtonOnTextShadow, "_alpha", Math.easeOutCubic, ButtonPressMin, ButtonPressMax, ButtonPressDurationIn);
ButtonOnShadow_twn.stop();
// Button Clicked
ButtonClicked = function () {
for (i=0; i<Number(_parent.menuItems_arr.length); i++) {
_parent["button"+i].MBMT.MovingTxtShd_txt.setTextFormat(BtnShd_fmt);
_parent["button"+i].buttonon_twn.continueTo(FadeMin);
_parent["button"+i].buttononshadow_twn.continueTo(FadeMin);
_parent["button"+i].buttonontextshadow_twn.continueTo(FadeMin);
_parent["button"+i].fadeOut();
_parent["button"+i].enabled = true;
}
ButtonOn_twn.continueTo(FadeMax);
ButtonOnShadow_twn.continueTo(FadeMax);
ButtonOnTextShadow_twn.continueTo(FadeMax);
MBMT.MovingTxtShd_txt.setTextFormat(BtnClkTxtShd_fmt);
// getURL(this.ContentURL, Frm);
enabled = false;
setSection(Menu);
};
//Send message to Left Menu to change
setSection = function (Menu) {
trace("message variable is "+Menu);
var my_lc = new LocalConnection();
my_lc.send("incoming", "GetMenuArea", Menu);
delete my_lc;
};
//Fade me in
fadeIn = function () {
BtnFade_twn.continueTo(FadeMax);
MovingTxt_twn.continueTo(MoveMax);
TextFade_twn.continueTo(FadeMax);
};
// Fade me out
fadeOut = function () {
BtnFade_twn.continueTo(FadeMin);
MovingTxt_twn.continueTo(MoveMin);
TextFade_twn.continueTo(FadeMin);
};
//
// Start fadeIn onRollOver
onRollOver = function () {
fadeIn();
};
// Start fadeOut onRollOut
onRollOut = function () {
fadeOut();
};
onPress = function () {
ButtonClicked();
};
It is a button that has some tweening animation in it but seems to come to a bit of a crawl when there is another swf of the page that it is connected to with a local connection. there are six of the running across the top menu panel in close succession.
Optimizing Flash
My Flash file is tooooooo big. I read that:
Set all of your symbols' behaviors to "graphic." Once you have everything perfect, set each layer in the final scene to "movieclip," then output it. This can reduce the file size by as much as 75 percent.
But how exactly do you do this? I tried clicking on each one of the key frames and changing it to "movie clip" in the instance panel - but that actually added size. Any suggestions?
Forgive this question - I will always be a newbie.
Optimizing Jpgs
Someone help!
I put together a site for my concert photography. I have a lot of pictures on there, but someone told me not to worry since flash optimizes jpgs on export. I knew my site was going to be large sizewise, but it's 3.2 megs and most people with modem connections can't get past the loading page. I originally had it set so that all of the site loads in before it proceeds to the main page but now I've had to change it so that once the first half of the pics load it continues to the main page while still loading. And still modem people can't get into it. It seems to just hang up on the loader. I have DSL and it loads in 5 seconds. Do I need to create an HTML site to mirror the flash site or is there some way I can bring the file sizes down without losing the clarity? I had originally laid out the design in Photoshop at 72dpi and then cut /pasted the jpgs into the flash site.
If someone wants to look at it, it's
http://www.visiblerhythm.com
Thanks!
Optimizing CPU Performance
I have alot of movies that fade in and out, does it use very much system resources constantly doing a 1 frame loop. Will I get better performance if i stop them, or will it probably not be noticeable.
Optimizing My Code
Hi everyone,
I'm finally getting with the times and using better syntax in my coding. Getting rid of all thos old telltargets. I've got a question though - I have taken this snippet of code:
--------------
stop();
tellTarget ("_root.button") {
gotoAndStop(1);
}
tellTarget ("_root.forward") {
gotoAndStop(1);
}
if (scene=="next") {
tellTarget ("root") {
unloadMovie("loadclip");
loadMovie("02.swf", "loadclip");
}
} else if (scene=="previous") {
tellTarget ("root") {
unloadMovie("loadclip");
gotoAndPlay("start");
}
}
---------------
And changed it into this:
-------------------------
stop();
_root.button.gotoAndStop(1);
_root.forward.gotoAndStop(1);
if (scene=="next") {
with ("root") {
unloadMovie("loadclip");
loadMovie("02.swf", "loadclip");
}
} else if (scene=="previous") {
with ("root") {
unloadMovie("loadclip");
loadMovie("01.swf", "loadclip");
}
}
------------------------
Looks much better. But I want to get rid of the 'with' command as well and just put in:
if (scene=="next") {
_root.unloadmovie("loadclip");
_root.loadMovie("02.swf", "loadclip");
}
When I do that however, it loads the move 02.swf overtop of everything else on the stage - When I use the 'with' or telltarget command, it loads 02.swf into the proper layer where I want it.
I'm wondering why it does that? It works fine with the 'with' command, but why it won't work with the shorthand syntax, I dunno.
Any suggestions would be greatly appreciated!! Thanks
Optimizing In Different Browsers
Hi i'm about to launch a new website in html (unfortunately), but I need to optimize it in lots of different versions of explore and netscape. How do you do that best? Any good solutions?
Thomas
Denmark
Photo Optimizing
ok this is my issue. I am creating a flash movie that has some jpg photos in it that I took with a digital camera. The camera is ok so I have to get the photos and edit them in fireworks. I am then saving them to a folder and importing them into the flash library. I then place them in the movie test and the movie looks great. Now when I save the swf and import it into an html page in ultradev and view the movie in the browser the photos come out really blurry and choppy. Should I optimize the photos any other way in flash? Has anyone had this issue?
Optimizing My Mx Site
i have completed my site and i am going to have to add a few sound bites. but, i want to know is there a special procedure for optimizing or will i need to go through the site library and delete things not used.
sincerely,
nymagic
Optimizing Movie
Hey, I've got a main movie which loads some other movies. . .I'll attach the fla. . .anyways, this particular movie has the falling matrix kind of letters, and it runs a little slow on dial up. I was wondering if anyone had any ideas about how to optimize it to make it run better. The biggest thing in this movie, according to the size report (pasted below) is the embedding of _sans font items. . .I didn't think that flash needed to embed this, but if I don't, the second line doesn't show up. . .whatever. Anyways, any help would be hot.
Movie Report
-------------
FrameFrame # Frame Bytes Total Bytes Page
------------ ----------- ----------- ---------------
1 3268 3268 Scene 1
2 21 3289 2
3 2 3291 3
4 15 3306 4
5 3968 7274 5
Page Shape Bytes Text Bytes
----------------------- ----------- ----------
Scene 1 41 124
Page Symbol Bytes Text Bytes
----------------------- ------------ ----------
LineAnimator 0 0
LetterMovieAnimator 0 0
LetterMovie 0 328
Sound name Bytes Format
----------------------- --------- ----------
Matrix Code NFI Bold 1845 abcdefghijklmnopqrstuvwxyz
_sans 3018 ,.023ABDGIMSabcdegilnoprstuy©
Image Optimizing
hi, i'm looking for some tried and true methods for the getting the best possible image with the least amount of filesize in flash. i know all the tricks with photoshop and imagready or whatever other program i may be using, but i don't know if there's anything inside flash to optimize the images even more and make them stay as clear as possible. (this is a portfolio site so i really want the images to be great) thanks!
Optimizing Filesize
Hi Flashers!
I try to reduce the filesize of my .swf, which is too big.
Some Questions:
1. Better Symbols or gif?
--------------------
in the movie are some difficult freehand sketches, and I am not sure if it is better to make a screenshot of this sketches.
(I copied the freehand data via cut and paste to the flash movie- very much objects!)
2. Wav Or MP3?
-------------
If I try to use mp3 files instead of wav files and set the audio settings to speech, but the movie filesize increase very much?!
(From 1.8mb to 2.6mb!!)
3. Any other tips?
---------------
Can someone tell me other tips & hints to reduce the filesize?
Thank you for helping me!
Regards,
Mikalux
Optimizing Movie
Please help with optiminzing. I am working a site and put a simple splash page but I think it takes too long to load. And I have DSL.
Please give any feed back from the page. www.sensers.com/menu.htm
thnks
Optimizing Code...
Hello,
I am new to Flash. Is there something one can do to sections of code that are re-used in an fla file to optimize swf file sizes? If so, where might I be able to learn more about it?
Thanks
Todd Lerner
Preloader And Optimizing
well...yes...I'm new...and I've got a bit of a problem...I need to make my flash site load faster...i'm new to the program....i have MX...and I just need some help....When I stream it in the program...it takes quite awhile. I've got a preloader on it, which keeps it from loading piece by piece...but...it's a slow process. How can i make the thing load faster...and...
On my preloader...currently I've got "loading.." and the percent loaded displays. I'd like to do a bar loader...but I'd like to have the fill area be an outline of 4 people ( this is a site i'm doing for a band ) How can I do this? Any help would be AWESOME!!!
Optimizing Site
i am working on my portfolio site in Flash MX... things are overall going well, but the site moves very slow... I used actionscript for all my animations, I really don't know what is slowing it down so much...
you can find the site at www.flowingmist.web1000.com/portofolio
and the sources at
www.readme.go.ro/portofoilu.ace and
www.readme.go.ro/portofoilu.c00
the archives have about 1,6MB together...
if anyone would care to take a look at them and explain me what is going wrong, maybe even give me an example of what to do to improve the speed, he'd definetily have a top place in my "thanks to" list
Help Optimizing Animation.
Hello!
We are a class of media students that are doing a flash homepage, an interactive band room with musicians that are being animated while playing music. So far, we have only made a flash movie containing the animations, and have encountered a problem. The document is set to 21 fps, and every band room (scene) contains around 10 movie clips with animation sequenzes between 3 and 40 frames long. Everything is made with vector graphics. As we publish the file, it is only about 2.5 megs in size, but the animations consume all processor power of our 2.4 gHz computers and the movie clip can only run at about 4 fps.
We would be really thankful for all suggestions on how to optimize the document so it runs smoothly. If you have questions on certain aspects of the animations, just go ahead and ask.
Optimizing Site
Hi,
In the site I'm making, I've chosen to use a large number of "contentpanels" which are linked for AS in the library. I load them with attachMovie to mc's on the main stage. This works fine.
However, now i find it takes a long time before it's loaded. Nothing will show up untill every linked object is loaded, not even the preloader.
2 questions:
- is it smart to use attchMovie and linked-fro-AS items? are there alternatives (eg working with invisible layers or loadMovie)
- How can i get my preloader visible? The loading time is acceptable but wihout preloader its to long.
Take a look at the site i am working on (just a test site, all images must be replaced by nice ones):
test site BTM
tenx! nls
Optimizing Software
Hey guys!
I have a signature that I'm wanting to optimize. I've downloaded the 'Flash optimizer' demo, but I dont think its possible to save the final optimized file - and unfortunately its the only optimization software/shareware I have found that has optimized my currently 600kb file to 210kb. (all others get it to about 450kb).
Can anyone reccommend any other shareware optimizers that optimize to a similar capacity? Or can anyone optimize my file for me with a version of flash optimizer??
cheers!
Swf Optimizing Help And Software...
I was wondering if anyone here has used registered copies of softare like flash optimizer or swf optimizer and what your feelings were about these programs.
I downloaded flash optimizer and tried the demo and it looked like it deleted things out of my file that I needed, but I couldn't really be sure because of the limited use of the demo, no saving.
Any recommendations?
I'm trying to figure out why this small file I have is almost 50kb. It seems like I should be able to get it smaller. I'm attaching the file report and the swf. I'm using a loadMovie command on rollOver to bring in the jpgs so none of the photos are actually in the flash file.
Optimizing Images
Hey guys, I am making a banner ad and need help optimizing it. Whats the best way to optimize my images?
Optimizing Movies
I need to optimize my Flash movie. I have it down to 700KB~ and I would like to get it closer to 500KB. I have a movie, bitmaps, tweens, sound, etc.
Got any links, tutorials, tips, etc?
Optimizing Your ActionScript
For ANYONE concerned with making your swf files run faster, this is a must read!
http://flasm.sourceforge.net/#optimization
While your at it, download the product and learn to use it because it free.
Optimizing Swf's Loadings For The Web
Right now i'm working on my cv and as it happens its a web page, and it has lots of jpegs. Right now the problem I have is that the actual loading of the whole swf is a bit too slow....... so iwas wondering what is the best way to optimize my file, and the loading. Ive seen on many web pages that images "load" all the time in the file, like every image apperars to load separetly. How is this done?
Is it loading .swf movies on an upper level? cause i trid that and for some reason when i upload it to the web it doesnt seem to find the other swf files.
Id appreciate any help!
thanks! bye
Optimizing Images
hi.. im duayne.. im just new to flash..
im rebuilding my site and this time im thinking of putting a flash intro..
ive done a short intro, with images that i made with Photoshop.
my problem is, in what format should i save my images so that they would not be distorted?
i know it not about flash , but its somewhat similar.
i have this image of a ring rotating around a center ball.. i made the ring a transparent background .gif. but when i imported it to flash, i found out that the edges of the images are rough..
what should i do to keep my images in good quality? thanks..
Optimizing The .Avi Format
I made an animation, but I cant make the file size small enough.
I am using
-320x240 resolution
-All images are made in grayscale pallette.
-Mono 24 Khz .wav sound (Flash converts to mp3, right?)
-All frames are raster .jpeg images, no vectors being used
-Almost no tweening, it's fpf animation.
-I have 2200~ frames so far (2:01 minutes long, with 24 Fps)
The exported .avi file compressed with DivX Codec 5.2.1 is about 122 MB.
I just checked a random anime file I have, and its 170 MB, but its higher resolution, colored, better sound, and about 12x as long (23:53 minutes).
How can I get this same performance?
Any tip is very welcome. Thanks a million for your time.
Optimizing Project
I've got a Flash-project almost done now and I want to optimize it as much as possible so I have some questions of what I should think about etc.
1. I have several Imported Bitmaps that I also have as MC's, is this necessary or is it better to just stick with the Bitmap-files? Or can I use a different, better way for this?
2. I've deleted "Unused items"
3. Publish settings looks fine.
4. Does "Convert stereo to mono" have any noticeable affect?
5. Can I double check something in the AS, it works fine but that doesn't have to mean that it's completely correct, does it? I know there's lots of different ways to script the same things, so that I like to know is if there's any common traps that usually can slip through
Anything else?
[F8]help Optimizing A Class
ok, Iv written this class that is supposed to get an array of objects, sort them into quadrants and check each quadrant in itself for collisions, but its running a bit slow and I need a little bit of help making it run faster...
(Top.Vector is my own class, its baisically contains x,y and a few methods...)
Code:
import Top.Vector;
import flash.geom.Rectangle;
class Top.CollisionHandler
{
//set up vars
private var movArray : Array;
private var staArray : Array;
//corner rectangles to see which an object is in
public static var ulRec : Rectangle = new Rectangle (0, 0, (Stage.width / 2) , (Stage.height / 2));
public static var urRec : Rectangle = new Rectangle ((Stage.width / 2) , 0, (Stage.width / 2) , (Stage.height / 2));
public static var dlRec : Rectangle = new Rectangle (0, (Stage.height / 2) , (Stage.width / 2) , (Stage.height / 2));
public static var drRec : Rectangle = new Rectangle ((Stage.width / 2) , (Stage.height / 2) , (Stage.width / 2) , (Stage.height / 2));
public static var recArray:Array = [ulRec, urRec, dlRec, drRec];
private var i:Number;
private var k:Number;
private var j:Number;
private var h:Number;
private var tempVec:Vector;
private var sortArray:Array;
private var sorted:Boolean;
public function CollisionHandler ()
{
movArray = new Array ();
staArray = new Array ();
}
public function giveArrays (_movArray : Array, _staArray : Array) : Void
{
movArray = _movArray;
staArray = _staArray;
checkCollisions ();
}
private function checkCollisions () : Void
{
sortMoving ();
// loop through all corners
for(i in sortArray){
// if its sorted
if(i != 4){
//check collisions in the objects inside that corner
for(k in sortArray[i]){
for(j in sortArray[i]){
//dont check it against itself
if(j != k){
//if its colliding
//checkCollision returns true or false
if(sortArray[i][k].checkCollision(sortArray[i][j])){
sortArray[i][k].handleCollision(sortArray[i][j]);
}
}
}
//now check it against stationary obs
for(j in staArray[i]){
//if its colliding
if(sortArray[i][k].checkCollision(sortArray[i][j])){
sortArray[i][k].handleCollision(sortArray[i][j]);
}
}
}
//done with sorted objects
//now checking the unsorted
}else{
//h is the unsorted objects... j is the sorted array... k is the sorted object
for(h in sortArray[4]){
for(j in sortArray){
//if its array 4 it will deal with it later
if(j != 4){
for(k in sortArray[j]){
if(sortArray[4][h].checkCollision(sortArray[j][k])){
sortArray[4][h].handleCollision(sortArray[j][k]);
}
}
//now check unsorted v stationary
for(k in staArray[j]){
if(sortArray[4][h].checkCollision(staArray[j][k])){
sortArray[4][h].handleCollision(staArray[j][k]);
}
}
//now check unsorted v unsorted
}else{
//k is the other object
for(k in sortArray[4]){
//dont check against self
if(k != h){
if(sortArray[4][h].checkCollision(sortArray[4][k])){
sortArray[4][h].handleCollision(sortArray[4][k]);
}
}
}
}
}
}
}
}
}
private function sortMoving () : Void
{
// the first array inside sortArray is top left, 1 is top right, 2 is bottom left,
// 3 is bottom right, and 4 is everyting else....
//the stationairy array is alreadyd sorted because things inside of it don't move (obvious)
//this is the same with the rectangle array
sortArray = [];
sortArray[0] = [];
sortArray[1] = [];
sortArray[2] = [];
sortArray[3] = [];
sortArray[4] = [];
for(i in movArray){
sorted = false;
if(movArray[i].getType() == "rectangle"){
for(k in recArray){
if(recArray[k].containsRectangle(movArray[i].getRectangle())){
sortArray[k].push(movArray[i]);
sorted = true;
break;
}
}
}else{
tempVec = movArray[i].getPoint();
for(k in recArray){
if(recArray[k].contains(tempVec.x, tempVec.y)){
sortArray[k].push(movArray[i]);
sorted = true;
break;
}
}
}
//if no match was found, put it the evcerthign else array
if(!sorted){
sortArray[4].push(movArray[i]);
}
}
//done sorting
}
}
thanks in advance
Optimizing Particles In AS3
Hi Guys
I have a quick question for you all. I'm in the middle of developing a shooter which has a particle class that is spawning a lot of movieclip instances (all of which are vector art). Is there any way to optimize particles in AS3 to improve speed/performance (without destroying any of the older instances)? I've noticed things get a little sluggish when there's 250+ instances.
If there's no alternative then I was thinking of killing off old instances and recycling them, but I'm hoping to avoid that.
Any ideas?
Help Optimizing This Script....
hello there, im new programming in flash and i need help with this if any one can assist me.
im recibing 250 variables from mySql with a php page into flash, each variable belongs to a department detail. there are 3 status on the departments
availeable, notAvaileable, and closed
what im doing is:
if the variable = closed the button is not enabled and its invisible
if the variable = notAvaileable the buton is enabled but with a _alpha50
if the variable = availeable, nothing happens.
it works fine
if (estatusA0001 == "closed")
{
a0001.enabled = false;
a0001._alpha = 0;
} else if (estatusA0001 == "notAvaileable")
{
a0001.enabled = false;
a0001._alpha = 50;
}
What i need help for is making like a while or a for so i dont have to write 250 if, else if.
i hope anyone can help me. thanks
[CS3] Help Optimizing This Code
hello there.... i need help on this...
i have to repeat this code 251 times how ca i optimized with a for or something like that
dpt1.onRollOver = function () {
torre = torre1;
piso = piso1;
numDepto = numDepto1;
acabados = pPlus1;
tipoDepto = tipoDepto1;
}
dpt1.onRollOut = function () {
torre = "";
piso = "";
numDepto = "";
acabados = "";
tipoDepto = "";
}
dpt1.onRelease = function () {
torre = torre1;
numDepto = numDepto1;
loadVariables("conteo.php", "", "POST");
}
/*-------------------02-------------------*/
dpt2.onRollOver = function () {
torre = torre2;
piso = piso2;
numDepto = numDepto2;
acabados = pPlus2;
tipoDepto = tipoDepto2;
}
dpt2.onRollOut = function () {
torre = "";
piso = "";
numDepto = "";
acabados = "";
tipoDepto = "";
}
dpt2.onRelease = function () {
torre = torre2;
numDepto = numDepto2;
loadVariables("conteo.php", "", "POST");
}
the values of dtp, torre, piso, numDepto, acabados, tipoDepto will be increase from 1 to 251
THANKS
Help Optimizing Code
Hi...
Bit stumped as for a better way to write this. I'd be grateful if someone could offer soem advice...
PHP Code:
//set up listeners...
btn1.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn1.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn1.addEventListener(MouseEvent.CLICK, onClickHandler);
btn1.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn2.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn2.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn2.addEventListener(MouseEvent.CLICK, onClickHandler);
btn2.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn3.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn3.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn3.addEventListener(MouseEvent.CLICK, onClickHandler);
btn3.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn4.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn4.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn4.addEventListener(MouseEvent.CLICK, onClickHandler);
btn4.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn5.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn5.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn5.addEventListener(MouseEvent.CLICK, onClickHandler);
btn5.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn6.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn6.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn6.addEventListener(MouseEvent.CLICK, onClickHandler);
btn6.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn7.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn7.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn7.addEventListener(MouseEvent.CLICK, onClickHandler);
btn7.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
btn8.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
btn8.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
btn8.addEventListener(MouseEvent.CLICK, onClickHandler);
btn8.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
// if you want a hand cursor...
btn1.useHandCursor = true;
btn2.useHandCursor = true;
btn3.useHandCursor = true;
btn4.useHandCursor = true;
btn5.useHandCursor = true;
btn6.useHandCursor = true;
btn7.useHandCursor = true;
btn8.useHandCursor = true;
//set up button modes...
btn1.buttonmode = true;
btn2.buttonmode = true;
btn3.buttonmode = true;
btn4.buttonmode = true;
btn5.buttonmode = true;
btn6.buttonmode = true;
btn7.buttonmode = true;
btn8.buttonmode = true;
thanks in advance...
Jeff
Optimizing - Getting Rid Of OnEnterFrame
Hey all,
I am building a pretty simple side scrolling game in flash, and I have a question about optimization. I'm building a series of classes to make the thing modulare so I can keep building levels and adding to it as I get older, and I have a question about how best to handle something. I have this code working in my spikeClass, but it kind of scares me because it has an onEnterFrame, and thus, if I place too many spikes on the stage at once, Flash will almost certainly bog down and not perform all that well, so my question is:
Is there any way I could set up something that is less memory intesnsive (A listener or somesuch) that will still register and fire the function at the appropriate time??
ActionScript Code:
class coms.spikeClass extends MovieClip {
function spikeClass() {
onEnterFrame = onEnterFrameHandler;
}
public function init() {
trace("you have a spike");
}
function onEnterFrameHandler():Void {
if (this.hitTest(_parent.myPet1)) {
// if this hits the myPet1(_global.mainmyPet1)
if (_global.main.health.text<=0) {
// if the health is smller than or equal to 0
_global.main.dead = true;
// _global.maindead is true
}
if (!_global.main.dead) {
//if NOT _global.main.dead
_global.main._x = 0;
// the _roots timeline's x is set to 0
_global.main.health.text -= 5;
// health goes down 5
_global.main.myPet1._x = _global.main.myPet1.startX;
// the myPet1 mc's X is set to its variable startX
_global.main.myPet1._y = _global.main.myPet1.startY+Stage.height/2;
// the myPet1 mc's Y is set to its variable startY plus the stages height diveded by 2
_global.main.myPet1.speed = 0;
// myPet1's speed is 0
}
}
}
}
Any help, as always, is appreciated!
Help Optimizing An XML Issue.
In my project I have need for a routine similar to the following:
myKey = [];
myValue = [];
for each (var child:XML in myxml.*) {
var namestr:String = child.name();
var valuestr:String = myxml[namestr];
if (matchMyCondition(namestr)) {
myKey.push(namestr);
myValue.push(valuestr);
}
}
function matchMyCondition(str:String):Boolean {
.....doesn't matter for this question. Is working fine.
return true or false;
}
The code runs okay.
Buy is very slow.
The line that contributes 95% of the slowness is:
var valuestr:String = myxml[namestr];
Is there a better (i.e. faster or more appropriate) way to get this information? Obviously the myxml[namestr] is slow. If I could grab that info a different way, would be better.
Thanks for any clues,
Claude
<hash>
<key00>value00</key00>
<key01>value01</key01>
<key02>value02</key02>
<key03>value03</key03>
<key04>value04</key04>
<key05>value05</key05>
<key06>value06</key06>
<key07>value07</key07>
</hash>
Optimizing Flash?
www.charred-ice.net/odoacer/art/colors.htm
i have a fairly fast system (athlon 1.4) with plenty of memory (256 ddr) and yet this still runs choppy. How do i optimize it? Everything is done by actionscript... theres no tweening whatsoever and the circles are flash-generated vectors. There's just a lot of them.
Any ideas about how i should improve this... anyone wanna see my source? but it's pretty messy
for a hidden feature, click and keep your mouse button pressed for a few seconds...
Optimizing Video
I have many movies, I would like to convert to flv files. I would like to know, what I can do to make the file size as small as possible, and make it a good / high quality. Youtube does a good job of this.
I currently make the bitrate ~500 and the resolution 320x240
Any suggestions?
Need A Little Advice On Optimizing...
I'm creating my first "larger" Flash site.. lots of images, videos etc. I've been trying to find out the best way to organize my site for optimal download speed.
Does anyone have any advice or articles/tutorials that they can pass along?
Thanks!
Lori
Optimizing Application
Simple reflexion
I have an Application that display many Thumbnails. We never know how many, but lets say 250.
I'm thinking on how to optimize the Application. Now one thing I'm confuse on or simply... Well if I have a container that holds 250 thumbnails. The only thing I need to know of each Thumbs is the mouse over, out and click.
I can set addEventListener on each Thumbnails for these 3 events. So the container will listener 750 Events OR
set the three type of listener to the container and use the capture phase of the event flow
addEventListener(MouseEvent.MOUSE_OVER, doSomething, true);
private function doSomething(evt:MouseEvent):void
{
trace(evt.target);
}
Well it works great. My question is more about setting the third parameters to true does it change the Flash flow way and does it can slowdown or whatever. Does anybody add this situation and have some comments, well, just need opinion on that or real optimization facts.
Thak's for your help
Optimizing Actionscript
Are there any actionscript optimizing programs out there for mac? Does anyone know if you use MX 2004 to export swf for Flash 6 Player if the swf runs better than if you used MX?
|