Bitmap Split/lasso Cut = Optimizing ?
Sorry if you already saw this subject lot of times but i have a very precise question i can't find an answer...
- I have a bitmap on my scene - I use the Modification/split tool, then i cut parts of the bitmap i don't need to be visible using the lasso.
Here's my question : Does it reduce the size of the swf ?
Thank you for help
FlashKit > Flash Help > Flash General Help
Posted on: 04-15-2005, 07:29 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Bitmap Tracing & Optimizing, Best Settings
HI, I am making a site where I have to use twelve small high quality jpegs, that I will convert to vector graphics so that I can make my movie 100% resizeable. My main obstacle is file size. Right now it's costing me about 70k per image. The high quality images are being imported at about 10k each, I then 'Trace Bitmap' and then 'Optimize.' I publish with jpeg quality 30 and the file size is still large. I used color threshold:10, minimum area: 1px, curve-fitixels, normal corner threshold.
I feel like I'm doing something wrong, any help is greatly appreciated.. Thx!
[CS3][AS2] Split Bitmap And Animate Each Divided Part ?
Hi ,
I am trying to make a photo gallery where images are shown in grid and when you click any of them it will split to 12 parts and and each of parts with its own speed will grow and go to its position . I made it but i don't think i've done it in the best way it could be done ( Maybe i done it in worst way it could be done, because this is the first time i use BitmapClass. :P ). If you know better way of doing the same thing , tell me how.
http://img380.imageshack.us/my.php?i...fillas2xb1.swf
I have problems with it , when you click the thumb it splits and grows good , but then you click to close it , when its small again , you cant click again to same image ... i know its because i didn't remove MovieClips after Tween is completed but when i do that ... i dont it again dont work good
here is the code:
PHP Code:
/*Import*/import caurina.transitions.*;import flash.display.*;import flash.geom.*;/*Variables*/var XPieces = 4+1;var YPieces = 3+1;var RecW = 200;var RecH = 200;var RecX = 200;var RecY = 200;var Pieces = (XPieces-1)*(YPieces-1);var image:Array = ["image1", "image2", "image3", "image4"];var Image:Number;var i = 0;var IO:Boolean = false;var Opened = "";var OpenSpeed:Number = 0.1;/*Close Image*/function Close(C) { if(IO){ i = 0; for (Y:Number = 1; Y<YPieces; Y++) {; for (X:Number = 1; X<XPieces; X++) {; Tweener.addTween(this["Piece"+X+Y+Image],{_x:C._x+20*X-20, _y:C._y+20*Y-20, _xscale:10, _yscale:10, time:(1+(X/Y*OpenSpeed))}); trace("LAST"); i++; this["Piece"+X+Y+Image].swapDepths(0+i); } } Opened = null; IO = false; }}/*Remove Image*/function Remove() { for (Y:Number = 1; Y<YPieces; Y++) {; for (X:Number = 1; X<XPieces; X++) {; trace("-----REMOVE------"); trace("Piece"+X+Y+Image); removeMovieClip("Piece"+X+Y+Image); } }}/*Open Image*/function Open(Image1, I) { Image = Image1; for (Y:Number = 1; Y<YPieces; Y++) {; for (X:Number = 1; X<XPieces; X++) {; i++; createImage(X,Y,I,Image); } }}/*Create Image*/function createImage(XP:Number, YP:Number, O, k) { _root.createEmptyMovieClip("Piece"+X+Y+Image,this.getNextHighestDepth()+Pieces-i); trace("Piece"+X+Y+Image); this["Piece"+X+Y+Image]._xscale = 10; this["Piece"+X+Y+Image]._yscale = 10; var matrix:Matrix = new Matrix(); matrix.tx = (RecW*X-RecW)*(-1); matrix.ty = (RecH*Y-RecH)*(-1); this["Piece"+X+Y+Image].lineStyle(1,0x000000,0); var img:BitmapData = BitmapData.loadBitmap(image[k]); this["Piece"+X+Y+Image].beginBitmapFill(img,matrix,true,true); drawRectangle(this["Piece"+X+Y+Image],0,0,RecW,RecH); this["Piece"+X+Y+Image].endFill(); this["Piece"+X+Y+Image]._x = O._x+this["Piece"+X+Y+Image]._width*X-this["Piece"+X+Y+Image]._width; this["Piece"+X+Y+Image]._y = O._y+this["Piece"+X+Y+Image]._height*Y-this["Piece"+X+Y+Image]._height; this["Piece"+X+Y+Image].onPress = function(){ trace(this); Close(Opened); } Tweener.addTween(this["Piece"+X+Y+Image],{_x:RecW*X-RecW, _y:RecH*Y-RecH, _xscale:100, _yscale:100, time:(1+(X/Y*OpenSpeed))});}/*Draw Rectangle Function*/function drawRectangle(target_mc:MovieClip, boxX:Number, boxY:Number, boxWidth:Number, boxHeight:Number) { target_mc.moveTo(boxX,boxY); target_mc.lineTo(boxX+boxWidth,boxY); target_mc.lineTo(boxX+boxWidth,boxY+boxHeight); target_mc.lineTo(boxX,boxY+boxHeight); target_mc.lineTo(boxX,boxY);}
I hope someone can help me ..
Thank you
Using The Lasso
I am having trouble using the lasso. Do many people use it? I am use to the Manetic Lasso in Photoshop. If I have a clipart...I break it apart...then lasso.
But it is not very neat. Is there a better way to do it?
Advice or recommendations?
Using The Lasso Tool
i would like to know how to use the lasso tool to do things like connect fore arms to upper arms and stuff using the lasso tool. could someone help me?
Lasso Tool?
Hello,
I've seached the help in flash and googled the topic to death but to no avail.
I want to do something that i hope is quite simple.
I have a photo of a chap and i want to select his bottom jaw and cause it to move up and down. I'll be buggered if i can work out how though..
Suggestions please
Lasso Or Crop?
I'm trying to figure out how to crop images smoothly, I know I can use the lasso tool but I don't know how to smooth out the edges, can somebody tell me how?
Lasso Selection Of One Or More Objects
Hi all.
I'm hunting for some guidance on how to achieve this one.
If you have seen a post or an example that might help me learn how I can sort this out I'd be really appreciative!
I need to devise a suitable way to drag a circle / elipse around one or more objects (Movieclips I guess), then leaving the circle where you stopped drawing it (like a marquee tool in photoshop) determining which objects are 'selected' inside that circle.
I've had a good search and gone through a million movies in order to try and figure this out.
Can anyone guide me a bit?
Thanks in advance!
Quag2000
Lasso Tool Gone Retarded
I'm sure I'm using it wrong. I'm using the polygonal lasso to select part of an edge on my object. Sometimes it will select that part, letting me move it or delete it, but other times it selects that part, and deletes the rest of the object (aka. crops the part I've selected). This is really annoying, and its done it about 15 times in a row.
Can anyone help?
Thanks in advance
Breaking A Drawing Apart Using Lasso
If I have drawn, say, a circle and filled it in using gradient filling.
Now I wanted to brake it into several pieces using lasso, but lasso does not
work on that drawing. I converted it into a graphic symbol - no joy.
How shal I make lasso to work in this context?
Can't Get Lasso Tool To Select Something
Hello all.
I'm going through the Flash CS3 Pro Classroom in a Book lessons, so in the waaaaay outside chance someone else reading this post has the book as well, I'm referring to lesson 2, on page 56.
Following the instructions, I'm supposed to draw a circle with the lasso tool around the top of a glass of water so the water (a bitmap image of water inside a glass shape) isn't a straight line.
But when I draw a circle around the top of the glass and release the mouse button, the circle just disappears. The history shows a lasso symbol with a red "x" by it. Is this an indication that I did something wrong?
I'm not sure if I'm providing enough information, but can someone maybe tell me what I'm doing wrong or missing?
Thanks for anyone's help!
BlueWorld Lasso And Flash
Anyone have any experience in tying together Flash and BlueWorld's Lasso middleware?
I'm trying to do something simple - a contact form for site visitors which will use Lasso's [email_send] to mail the input of a few fields to us.
What I can't figure out is how to get input fields in Flash to talk to Lasso.
Any help, steering to a place to get started would be much appreciated.
Thanks!
BlueWorld Lasso And Flash
Anyone have any experience in tying together Flash and BlueWorld's Lasso middleware?
I'm trying to do something simple - a contact form for site visitors which will use Lasso's [email_send] to mail the input of a few fields to us.
What I can't figure out is how to get input fields in Flash to talk to Lasso.
Any help, steering to a place to get started would be much appreciated.
Thanks!
How Do I Use Hte Magic Wand Instead Of Lasso?
Hi!
How do I use the magic wand where I can simple select the color and have it automatically select all of the color? All I see are a lasso tool but no magic wand tool. How do I do that?
Thanks,
FletchSOD
Split A Number Using Split?
is it possible for flash to identify a number and split it from the pack?
i am compiling a search using switch but for one section it is the same place over and over for instance ab1, ab2, ab3, ab4 points to one place & de1,de2,de3 points to another?
would just make it a lot quicker in the search if it could strip the number of and look up ab or de for example?
thanks
Dan
Using Lasso Tool With Imported Images
Hi,
I imported a JPEG image into Flash and I want to edit that image using the Lasso tool but flash won't let me.
Here is what I want to do:
-Look at the right image in this flash movie, you see how the picture is cropped (doesn't have rectagular edges), that's what I want to do with my image.
http://www.lehigh.edu/%7Einbios/
Thanks,
Create A Lasso Tool In Flash?
Hey, I'm trying to make a photoshop type lasso tool in flash. Have any of you ever made one. I saw a guy one time make a lasso tool in Director but that was 5 years ago. If you know anything that could point me in the right direction as to how to make one in flash I'd love you forever
Problem With Polygon Lasso Tool
I'm trying to use the polygon lasso tool to trace the roof of a building. Every time I complete (close) the tracing shape it automatically rounds a couple of the corners instead of leaving them at the angles they should be. The corners it is rounding seem to be very slight angles as opposed to the rest which are closer to 90 degree angles.
Is there a smoothing or snapping aspect of the polygon lasso tool that I need to turn off and if so how, or is something else happening here?
Thanks for any help!
Lasso, Filemaker And Flash Mx 2004 Pro
To all of you guys.....
You know how can I retrieve information trought lasso which is conected to a FM5 database? or any information related with Flash and Lasso or FileMaker?
thanks
Lasso, Filemaker And Flash Mx 2004 Pro
To all of you guys.....
You know how can I retrieve information trought lasso which is conected to a FM5 database? or any information related with Flash and Lasso or FileMaker?
thanks
Problem With Polygon Lasso Tool
I'm trying to use the polygon lasso tool to trace the roof of a building. Every time I complete (close) the tracing shape it automatically rounds a couple of the corners instead of leaving them at the angles they should be. The corners it is rounding seem to be very slight angles as opposed to the rest which are closer to 90 degree angles.
Is there a smoothing or snapping aspect of the polygon lasso tool that I need to turn off and if so how, or is something else happening here?
Thanks for any help!
Lasso Probs And How Do I Make My Image Transparent?
yup it's me again I guess some probs were up in my last POST?
anyway I really need to know how to make an image transparent in FLash, since I can make it transparent in Paint Shop Pro 7 when I imort it in it becomes a big frame over the pic and the background isn't transparent? I have tried Biutmaps and Jpgs so far.......
Help me...plz, thank U much
Magentic Lasso Tool Clone In Flash
Hello,
Is there anyone who has done Magentic Lasso Tool (as in Photoshop) or know how we can do that in Flash/Action Script (any version)...
I believe it can be done, but not sure how. Please also suggest if it is not possible with flash.
Make A Lasso Tool To Crop An Uploaded Image?
Greetings!
I'm trying to create a photoShop type lasso tool so users can crop out their heads in an image they uploaded. I have all the problems solved except for how to make the lasso so they can crop their head out. I figure lasso tool is the best way. I made a mask with curveTo but that only makes a circle. A lasso tool would be rad. Is there a way to like draw a line with a mouse around an image and then fill it and make that the mask? I figure you can createEmptyClip and then fill it up with draw but how do I make the lasso??
If any of you can point me in the right direction towards how to make a cropping/mask lasso tool i'd be very happy indeed
Resize Bitmap, Then Draw(Bitmap) To A Separate BitmapData, Doesn't Work Right...?
Hey everyone,
So, I'm loading a jpg into a BitmapData variable, which is liked to a Bitmap variable, then I resize the Bitmap variable.
Every 10 secs it unloads the current bitmap and loads a new one.
But I want to draw the resized bitmaps to a separate BitmapData Variable, except when I try and do that it draws it in the original size... ? Why doesn't it draw the new resized version?
Any ideas?
CopyPixels While Moving Bitmap When Overlay Layer Has Bitmap Effects Bug?
hi,
Wanted to create a walking character, using a large image of all this character postures as resource.
Did this:
1. Created a new Bitmap with its BitmapData
2. Created an EnterFrame event listener to this Bitmap where:
a. I move the Bitmap to the right
b. I change the character posture by copying pixels from the large image to the characters BitmapData
Works fine...
But then I've added another layer (sprite) on top of this bitmap.
Added a glow filter to this layer (sprite) and got the following bug:
The character (Bitmap) is leaving trails as it moves... as if Flash doesn't clean after it...
Please see attached files - it's all there, short and clear.
Basically, the pseudo code looks like this:
--------------------------------------------------------------------------------------------------------------
var __sourceBmpData:SourceBmpData = new SourceBmpData(72, 128);// SourceBmpData is a linkage name to an image on the library
var __imgBmpData:BitmapData = new BitmapData(24, 32, true, 0x00000000);
var __imgBmp:Bitmap = new Bitmap(__imgBmpData);
this.addChild(__imgBmp);
// add event listener
__imgBmp.addEventListener(Event.ENTER_FRAME, Walk);
// bug layer
var bug_mc:Sprite = new Sprite();
this.addChild(bug_mc);
var glow:GlowFilter = new GlowFilter();
glow.color = 0xFF0000;
bug_mc.filters = [glow];
// enter frame
private function Walk(event:Event):void {
__imgBmp.x = 32 + __posX * 12;
__imgBmpData.copyPixels(__sourceBmpData, new Rectangle((__posX % 3) * 24, 32, 24, 32), new Point(0, 0));
__posX++;
}
--------------------------------------------------------------------------------------------------------------
Is it a bug or am I doing somthing wrong?
Thanks,
EZ
CopyPixels While Moving Bitmap When Overlay Layer Has Bitmap Effects Bug?
hi,
Wanted to create a walking character, using a large image of all this character postures as resource.
Did this:
1. Created a new Bitmap with its BitmapData
2. Created an EnterFrame event listener to this Bitmap where:
a. I move the Bitmap to the right
b. I change the character posture by copying pixels from the large image to the characters BitmapData
Works fine...
But then I've added another layer (sprite) on top of this bitmap.
Added a glow filter to this layer (sprite) and got the following bug:
The character (Bitmap) is leaving trails as it moves... as if Flash doesn't clean after it...
Please see attached files - it's all there, short and clear.
Basically, the pseudo code looks like this:
--------------------------------------------------------------------------------------------------------------
var __sourceBmpData:SourceBmpData = new SourceBmpData(72, 128); // SourceBmpData is a linkage name to an image on the library
var __imgBmpData:BitmapData = new BitmapData(24, 32, true, 0x00000000);
var __imgBmp:Bitmap = new Bitmap(__imgBmpData);
this.addChild(__imgBmp);
// add event listener
__imgBmp.addEventListener(Event.ENTER_FRAME, Walk);
// bug layer
var bug_mc:Sprite = new Sprite();
this.addChild(bug_mc);
var glow:GlowFilter = new GlowFilter();
glow.color = 0xFF0000;
bug_mc.filters = [glow];
// enter frame
private function Walk(event:Event):void {
__imgBmp.x = 32 + __posX * 12;
__imgBmpData.copyPixels(__sourceBmpData, new Rectangle((__posX % 3) * 24, 32, 24, 32), new Point(0, 0));
__posX++;
}
--------------------------------------------------------------------------------------------------------------
Is it a bug or am I doing somthing wrong?
Thanks,
EZ
Can't See A Bitmap Under A Mask When Moving The Bitmap With Elastic Motion
The um... title... kinda said it all. I have a mask. I have a bitmap under the mask. I want to move the bitmap around with elastic motion so I put it in an MC and cut and pasted some functions.
I can see it moving fine when i delete the mask. And I can see it masked fine when I delete the functions. But when both are there I just get emtpy space.
Is there something I don't know but shoud about elastic motion and masks or is there something ****y going down and I probably need to post the FLA?
Thanks all,
-damnit.
Stretch Bitmap-filled Object W/o Stretching Bitmap?
I've got a bitmap-filled rectangle I'm using as a background. I'd like to resize the rectangle dynamically without stretching the bitmap, ie the bitmap needs to tile.
I can do it with BitmapData using the tile option, but it's really slow. Is there an easier way to do this that I'm missing?
Draw A Bitmap Line Or A Bitmap Polygon
I need to create a flash/flex/ActionScript3 program that allows user to draw lines and polygons with legends. The legends are provided as bitmap. I'm thinking that I have to use bitmapfill to do the work. Is this the best approach?
As the line may change the direction, I will need the bitmapfill to change direction following the direction of the line. What is the best way to do this? Any example out there?
For polygons, can we use bitmapfill to fill irregular shapes?
Thanks,
-Maggie
Bitmap Font Text Drawn To Bitmap
Is there a way to write a bitmap font right into the bitmap being desplayed?
Mabey better worded:
myBitmap.draw(image, t) draws a picture is there a way to draw text?
I'm stuck even if its just a work around in some way I would like to know... (the current work around i have in my head is writing it in a movieclip turning that into bitmap data and drawing it... esentially creating a prototype answering my question... but a built in way would be easier probably).
Draw A Bitmap Line Or A Bitmap Polygon
I need to create a flash/flex/ActionScript3 program that allows user to draw lines and polygons with legends. The legends are provided as bitmap. I'm thinking that I have to use bitmapfill to do the work. Is this the best approach?
As the line may change the direction, I will need the bitmapfill to change direction following the direction of the line. What is the best way to do this? Any example out there?
For polygons, can we use bitmapfill to fill irregular shapes?
Thanks,
-Maggie
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.
Faster Option Than Bitmap Smoothing? Or Speed Up Bitmap Smoothing?
Hey,
Is there any way to speed up bitmap smoothing? or to achieve the same effect with something less processor intensive? Or maybe a way to reduce the amount that it smooths or something. Btw, when I say speed up I mean less processor intensive.
In the project I'm currently working on the image must be rotated and scaled smoothly to 1.5 times it's starting size. If there is any different way to achieve a smooth-ish image please let me know. Even if it's really complicated, if it's at all faster I want it hear it.
How I'm currently doing it is I load in the images (jpg) from an XML file, create a bitmap take the bitmap data from the loaded jpg and enable smoothing. Then I add that bitmap to a movieclip and then I do my stuff from there. It's a complex photo viewer. It all works, but I need to make it work using less resources.
Any ideas are MUCH appreciated! Thanks
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.
|