-
Actionscript... v's.... Graphics
Can somebody tell me if it is better to design on the fly graphics in actionscript as opposed to creating real graphics on the stage?
What are the pros and cons of each?
thanx in advance.
-
Senior Member
There is a limit to graphics with actionscript. Also if you are a mathematician, you may get something but if you are like me...
- The right of the People to create Flash movies shall not be infringed. -
-
The reason im asking is that i have designed a site using on the fly graphics and one using graphics on the stage, they are both visually the same but there is a big difference in load time.
The Actionscript only .swf preloads for 0.8 seconds and the graphics on the stage .swf takes 0.3 seconds which has suprised me as i thought Actionscript was more efficient when loading in!
Is this right?
-
Senior Member
It probably depends on the graphic and its quality. There are a number of factors.
- The right of the People to create Flash movies shall not be infringed. -
-
they are just boxes with a 2 colour gradient fill, nothing too taxing for flash.
-
Senior Member
A gradient fill is pretty complex!
- The right of the People to create Flash movies shall not be infringed. -
-
I see!
This is a snippet of the code i have compiled for 2 of the on the fly boxes, is this the most efficent way of writing it? Its my first effort at on the fly actionscript graphics.
//MAINSCREEN ...draw top box
_root.createEmptyMovieClip("drawing", 20);
with (drawing) {
lineStyle(0.25, 0x999999, 100);
colorArray = [0x151515, 0xFFFFFF];
alphaArray = [100, 100];
ratioArray = [0x00, 0xFF];
matrix = {matrixType:"box", x:0, y:0, w:240, h:240, r90/180)*Math.PI};
beginGradientFill("linear", colorArray, alphaArray, ratioArray, matrix);
moveTo(-1, -1);
lineTo(801, -1);
lineTo(801, 100);
lineTo(-1, 100);
lineTo(-1, -1);
endFill();
moveTo(-1, 101);
lineStyle(0.25, 0x000000, 100);
lineTo(800, 101);
// ...draw bottom box
moveTo(-1, 500);
lineStyle(0.25, 0x999999, 100);
colorArray = [0xFFFFFF, 0x151515];
alphaArray = [100, 100];
ratioArray = [0x00, 0xFF];
matrix = {matrixType:"box", x:0, y:340, w:240, h:240, r90/180)*Math.PI};
beginGradientFill("linear", colorArray, alphaArray, ratioArray, matrix);
lineTo(800, 500);
lineTo(800, 600);
lineTo(-1, 600);
lineTo(-1, 500);
endFill();
moveTo(-1, 499.5);
lineStyle(0.25, 0x000000, 100);
lineTo(800, 499.5);//MAINSCREEN ...draw top box
-
Senior Member
I don't know but check the FlashMX help menu and search for gradientfill. There is a script.
- The right of the People to create Flash movies shall not be infringed. -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|