 |
Featured jobs
Featured template
View more templates
 |
 |


Next 5
// fed up on changing instance name for hundreds of MovieClip ???
 |
 |
// Create a Flash Javascript file
///////////////////////////////////////////
// ins_name.jsfl //
///////////////////////////////////////////
var my_val;
if(my_val == undefined){
my_val = -1;
}
my_val ++;
fl.getDocumentDOM().selection[0].name = "m_" + my_val;
// "m_" is the abbreviation with the increment instance names - change it to your needs ::
//Place the jsfl file into your commands folder.
//Select a movieclip and run the script.
//You will notice the instance of the MC was changed.
//:: To change the value of the string in the same way
fl.getDocumentDOM().selection[0].setTextString(my_val);
/////////////////////////////////////////
/// elangora@yahoo.com //
Posted by: Elangovan | website
http://www.chellamtamil.com
|
 |
 |
 |
//make a snipe game
 |
 |
onClipEvent (enterFrame) {
Mouse.hide
scope_mc._x = _xmouse
scope_mc._y = _ymouse
}
on (keypress”Space”) {
gotoAndStop(2)
}
----Sounds----
Posted by: joeyman | website
http://www.ultimatecreatures.com
|
 |
 |
 |
2 in 1 hex color mixer in percent
 |
 |
colors_2in1 = function (hex1, hex2, percent) {
var hex3, hex_ret, i;
hex1 = parseInt(hex1, 16);
hex2 = parseInt(hex2, 16);
for (i=2; i>=0; i--) {
hex3 = hex1 >> 8*i & 255;
hex3 += ((hex2 >> 8*i & 255)-hex3)/100*percent;
if (hex3<16) {
hex_ret += "0";
}
hex_ret += hex3.toString(16);
}
return hex_ret;
};
txt_num = 23;
txt_f1 = new TextFormat();
txt_f1.size = 18;
txt_f1.font = "Verdana";
txt_f1.bold = true;
for (i=0; i<=txt_num; i++) {
this.createTextField("txt_output"+i, i, 0, i*20, 0, 0);
with (this["txt_output"+i]) {
selectable = false;
autoSize = true;
textColor = "0x"+colors_2in1("0080ff", "00ff80", txt_num == 0 ? 0 : 100/txt_num*i);
text = "www.ADVANCE-MEDIA.com";
setTextFormat(txt_f1);
}
}
delete colors_2in1;
delete txt_f1;
delete txt_num;
delete i;
Posted by: Folko Langner | website
http://www.advance-media.com
|
 |
 |
 |
3 color text navigation
 |
 |
stop();
nav_caption = new Array("Crusader", "Inquisition", "Autodafé", "Coerced Conversion", "Flat Earth", "Letter of Indulgence");
outcol = 0x666666;
rollcol = 0x999999;
oncol = 0xcccccc;
txt_f = new TextFormat();
txt_f.size = 18;
txt_f.font = "Verdana";
txt_f.bold = true;
for (i=0; i<nav_caption.length; i++) {
this.createEmptyMovieClip("nav"+i, i);
this["nav"+i].stop();
this["nav"+i].meIs = i;
this["nav"+i].onRelease = function() {
setNav(this.meIs);
};
this["nav"+i].onRollOver = function() {
rOver(this.meIs);
};
this["nav"+i].onDragOut = function() {
rOff(this.meIs);
};
this["nav"+i].onRollOut = function() {
rOff(this.meIs);
};
this["nav"+i].createTextField("caption", 1, xPos, 0, 0, 0);
with (this["nav"+i].caption) {
selectable = false;
autoSize = true;
textColor = outcol;
text = nav_caption[i];
setTextFormat(txt_f);
xPos += textWidth+33;
}
}
delete nav_caption;
delete i;
delete txt_f;
delete xPos;
rOver = function (index) {
if (indexOn != index) {
col = new Color(this["nav"+index]);
col.setRGB(rollcol);
this["nav"+index].useHandCursor = true;
} else {
this["nav"+index].useHandCursor = false;
}
};
rOff = function (index) {
if (indexOn != index) {
col = new Color(this["nav"+index]);
col.setRGB(outcol);
}
};
setNav = function (index) {
if (indexOn != index) {
col = new Color(this["nav"+index]);
col.setRGB(oncol);
this["nav"+index].useHandCursor = false;
col = new Color(this["nav"+indexOn]);
col.setRGB(outcol);
indexOn = index;
}
};
setNav(0);
Posted by: Folko Langner | website
http://www.advance-media.com
|
 |
 |
 |
Actionscript shopping cart class
 |
 |
class cart
{
var cartObj;
var myCart;
var cartName : String;
function cart (strCartName : String)
{
cartName = strCartName;
myCart = SharedObject.getLocal (this.cartName);
if (myCart.data [this.cartName] == undefined)
{
myCart.data [this.cartName] = new Object ();
}
if (myCart.data [this.cartName].id == undefined)
{
myCart.data [this.cartName].id = new Object ();
}
_global.trace ("init cart " + myCart.data [this.cartName]);
}
function getCart ()
{
var retVal = "";
_global.trace (this.cartName);
for (var o in myCart.data [this.cartName].id)
{
retVal += o + ": " + myCart.data [this.cartName].id [o] + "\n";
for (var oo in myCart.data [this.cartName].id [o])
{
retVal += "\t" + oo + ": " + myCart.data [this.cartName].id [o][oo] + "\n";
}
}
return retVal;
}
function Exist (id)
{
if (myCart.data [this.cartName].id [id] == undefined)
return false;
else
return true;
}
function Add (id, obj)
{
_global.trace ("Add to cart:" + id);
if ( ! this.Exist (id))
{
myCart.data [this.cartName].id [id] = new Object ();
myCart.data [this.cartName].id [id] = obj;
} else
{
this.Update (id, obj);
}
myCart.flush ();
}
function Update (id, obj)
{
_global.trace ("Update cart:" + id);
if (this.Exist (id))
{
myCart.data [this.cartName].id [id] = obj;
myCart.flush ();
}
}
function Remove (id)
{
delete myCart.data [this.cartName].id [id]
_global.trace ("delete from cart:" + id);
}
function getCartCount ()
{
var i = 0;
for (var o in myCart.data [this.cartName].id)
{
i ++;
}
return i;
}
function getCartObject ()
{
return myCart.data [this.cartName].id;
}
}
Posted by: Isaac Levy | website
http://www.actionscript.org
|
 |
 |
 |
Next
5
|  |
Search Entire Site
Advertisements
Latest New Articles
- Set up a simple IIS Server for Flash
by Peter McBride - Day 1 at FITC Toronto 2008
by Anthony Pace - Simple reflection effect with AS2
by Jean Andr Mas - ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff - Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F
|
 |