Stick Page Forums Archive

How to customize Jeff's AC2 preloader [Flash][Preloaders]

Started by: Kodoku | Replies: 7 | Views: 1,562

Kodoku
2

Posts: 1,610
Joined: Dec 2012
Rep: 10

View Profile
Jul 19, 2013 11:36 AM #1039960
As you may know, on the resource's section, Jeff posted an actionscript 2 preloader where you only have to paste the code on the first frame of your animation. Well now I'll show you how to customize that preloader tou your taste!

Credits to Jeff for the Actionscript. We love you, Jeffie♥

This is the original code. I'll show you wich parts you have to change to customize it.

Code (Click to Show)


Before we start, remember. In flash, colour codes normaly looks like this: #00FF00
But in action script, the equivalent of that code is: 0x00FF00.
Other examples:
#FFCC00 = 0xFFCC00.

In other words, you have to copy the 6 letters/numbers of the code, and put "0x" before it.
Got it?


Okay, now. The first part.

// Draw Gradient
with(ploader.bgGrad) {
fillType = "linear";
colors = [0x666666, 0x000000];
alphas = [0, 75];
ratios = [0, 255];
matrix = {matrixType:"box", x:0, y:-200, w:200, h:200, r:90/180*Math.PI};
lineStyle(1, 0x000000, 0);
beginGradientFill(fillType, colors, alphas, ratios, matrix);
moveTo(0, 0);
lineTo(Stage.width, 0);
lineTo(Stage.width, -200);
lineTo(0, -200);
lineTo(0, 0);
endFill();
}

If you change the code that I put in bold, you can change the colour of the gradient. For example:
From this:
colors = [0x666666, 0x000000]; (http://www.filz.us/view/7b638b28-252/)

To this:
colors = [0xFFCC00, 0xFFCC00]; (http://www.filz.us/view/a1d0fd99-b56/)

To change the gradient place from the bottom to the top, you have to set the canvas at 550x300 (It only works on that size. If someone knows how to fix it, post here so I can add it), and change this part:

// Create Gradient MC
ploader.createEmptyMovieClip("bgGrad",ploader.getNextHighestDepth());
ploader.bgGrad.cacheAsBitmap = true;
ploader.bgGrad._x = -ploader._x;
ploader.bgGrad._y = Stage.height-ploader._y; If you change that minus (-) this symbol "%", the gradient will be on the top. it would look like this:

http://www.filz.us/view/86cd6c3f-9af/

But remember to change this:

// Draw Gradient in Lines Mask
with(ploader.linesMask) {
// Top
fillType = "linear";
colors = [0x000000, 0x000000];
alphas = [0, 80]; here switch places between "0" and "80" to invert the alpha.
ratios = [0, 255];
matrix = {matrixType:"box", x:Stage.width-(65*5), y:0, w:200, h:15, r:0/180*Math.PI};
lineStyle(1, 0x000000, 0);

Now that's for the colour of the gradient. Now, to change the diagonal lines' colour:

You have to do the same thing that last time. Change the codes.

// Create Lines
ploader.lines.lineStyle(1, 0xFFCC00); that code. Change the code to, for example, 0xFF0000 (red).
for (var i=0;i<75;i++) {
ploader.lines.moveTo(i*-5, 0);
ploader.lines.lineTo((i*-5)+50, 50);
}

when you change it, it would look like this:

http://www.filz.us/view/d40f1276-c06/

UPDATE!: The F-A-B-U-L-O-U-S preloader!

// Draw Gradient
with(ploader.bgGrad) {
fillType = "linear";
colors = [0xff0000, 0xffcc00, 0xffff00, 0x00ff00, 0x0000ff, 0x990099]; I added six colours to this one.
alphas = [0, 20, 40, 60, 80, 100]; you also have to add more numbers here, depending on the amount of colours. (only from 0 to 100)
ratios = [0, 50, 80, 130, 200, 255]; the same with these. they have to be from the smallest to the biggest. (only up to 255.)
matrix = {matrixType:"box", x:0, y:-200, w:200, h:200, r:90/180*Math.PI};
lineStyle(1, 0x000000, 0);
beginGradientFill(fillType, colors, alphas, ratios, matrix);
moveTo(0, 0);
lineTo(Stage.width, 0);
lineTo(Stage.width, -200);
lineTo(0, -200);
lineTo(0, 0);
endFill();
}

This is how it looks!

http://www.filz.us/view/1454b8aa-944/




Now let's change the text!

This is for the number of the preloader (line 93):

// Create Text
var T = ploader.tcont.createTextField("T",ploader.tcount.getNextHighestDepth(),0,0,400,100);
T.text = "0";
T.selectable = false;

function setTextFormat(textObject) {
var format:TextFormat = new TextFormat();
format.size = 100; with this you change the size. select a number!
format.letterSpacing = 15;
format.font = "Arial Narrow"; here you can write the name of any font you want I.E: "Arial black". Remember that it MUST be between quotation marks.
format.color = 0xFFFFFF; with this code, you can change the colour.
format.align = "right";
textObject.setTextFormat(format);
}

This is for the "loading" message (line 131, if you don't find it):

// Create Info Text Container
ploader.createEmptyMovieClip("infoText",ploader.getNextHighestDepth());
ploader.infoText.cacheAsBitmap = true;
ploader.infoText._x = Stage.width-415;
ploader.infoText._y = 95;

// Create Info Text
var iT = ploader.infoText.createTextField("iT",ploader.infoText.getNextHighestDepth(),0,0,400,100);
iT.text = "Now loading..."; <--- Put there your message, like "Just wait, you f***er."
iT.selectable = false;

function setTextFormat2(textObject) {
var format:TextFormat = new TextFormat();
format.size = 18; this for the size.
format.letterSpacing = 3;
format.font = "Arial"; this for the font,
format.color = 0xFFFFFF; this is for the colour.
format.align = "right";
textObject.setTextFormat(format);
}
setTextFormat2(iT);


Well, that's all you can edit. Actually, there are more things, but it's mostly colours. If you see this: "0x000000" for example, try and change the code to see what it comes out! Here's an example of one I made:

http://www.filz.us/view/aa908e02-bc7/

I hope you enjoy this, and I hope it helped.

Again, Thanks Jeff for this wonderful preloader♥
Damian
2

Posts: 5,026
Joined: Feb 2013
Rep: 10

View Profile
Jul 19, 2013 7:34 PM #1040291
Thank you and the Lord. It is a great thing that you exist.
Kodoku
2

Posts: 1,610
Joined: Dec 2012
Rep: 10

View Profile
Jul 19, 2013 9:05 PM #1040343
Not sure if sarcasm or...

Image

Lol thanks glad you liked it :3
Hydra
2

Posts: 1,486
Joined: Oct 2012
Rep: 10

View Profile
Jul 19, 2013 9:08 PM #1040346
duuuuuuuuuuuude that i sweet im gonna use this
Damian
2

Posts: 5,026
Joined: Feb 2013
Rep: 10

View Profile
Jul 19, 2013 11:58 PM #1040404
Quote from LFlL0
Not sure if sarcasm or...

Image

Lol thanks glad you liked it :3


No sarcasm. Problem is I usually use As3. Oh, well.
Kodoku
2

Posts: 1,610
Joined: Dec 2012
Rep: 10

View Profile
Jul 20, 2013 1:07 AM #1040448
Look at the update for the fabulous preloader!
Damian
2

Posts: 5,026
Joined: Feb 2013
Rep: 10

View Profile
Jul 20, 2013 1:21 AM #1040460
Quote from LFlL0
Look at the update for the fabulous preloader!


Yay! Nice, even though I prefer the "final" one. Great guide! Once again, thank you!
Kodoku
2

Posts: 1,610
Joined: Dec 2012
Rep: 10

View Profile
Jul 20, 2013 2:06 AM #1040504
Oh the fabulous one was to show how to add colours. In this one, I mixed An orange-ish yellow with red, to give a really warm or hot sensation:

http://www.filz.us/view/ce7ba520-a4d/

Oh and remember that the background colour can change the looks! I put a black rectangle in the background to make it look better.

Experiment with the codes! but don't change it too much, you may delete something important by accident.
Website Version: 1.0.4
© 2025 Max Games. All rights reserved.