Yes , It's a password box for use in games , flash websites and etc flash works . I use this code for a test game . "lp9sc" wrote this code for me , but FLA , SWF , and JPG guide files made by me .
//These variables are for the players status, and should be changed //to match the variables in all the swf files. Level0 will be needed */ var currentmanavar:Number = 10; var totalmanavar:Number = 20; var currenthealthvar:Number = 250; var totalhealthvar:Number = 300; var currentexpvar:Number = 72; var totalexpvar:Number = 350; //This function creates the gui; function guiInt(){ //Creates movieclip that holds the GUI. createEmptyMovieClip("gui", 10000, {_x:0, _y:0}); //This creates all the empty movie clips, then the code will fill it in. gui.createEmptyMovieClip("mahpxp", 1, {_x:0, _y:0}); var mc = gui.mahpxp; gui.createEmptyMovieClip("itemdatabase", 2, {_x:0, _y:0}); var idb = gui.itemdatabase; idb._x = 433; idb._y = 9; //Attaches the health, mana and exp bar at the top right (Grey potential bar) mc.attachMovie("stats_gfx6", "stats_gfx6", 1, {_x:10, _y:50, _width:210, _height:9.2}); mc.attachMovie("stats_gfx5", "stats_gfx5", 2, {_x:10, _y:35, _width:210, _height:9.2}); mc.attachMovie("stats_gfx7", "stats_gfx7", 3, {_x:10, _y:20, _width:210, _height:9.2}); //This transforms the potential bars colour to "myColourTransform" //this sets the colour of the grey bar in the background. (used for the amount of potential stat you can have var myColorTransform:Object = newObject(); var myColorTransform:Object = {ra:35, rb:102, ga:35, gb:102, ba:35, bb:102, aa:100, ab:86}; BarColourA = newColor(mc.stats_gfx6); BarColourB = newColor(mc.stats_gfx5); BarColourC = newColor(mc.stats_gfx7); BarColourA.setTransform(myColorTransform); BarColourB.setTransform(myColorTransform); BarColourC.setTransform(myColorTransform); //This creates the stat bars that show current amount of stat. mc.attachMovie("stats_gfx6", "exp_bar", 4, {_x:10, _y:50, _width:210, _height:9.2}); mc.attachMovie("stats_gfx5", "health_bar", 5, {_x:10, _y:35, _width:210, _height:9.2}); mc.attachMovie("stats_gfx7", "mana_bar", 6, {_x:10, _y:20, _width:210, _height:9.2}); //This sets a glow filter for the current amount of stat bars import flash.filters.GlowFilter; var myGlowFilter = new GlowFilter(0x333333, 100, 1, 1, 10, 3, false, false); mc.health_bar.filters = [myGlowFilter]; mc.mana_bar.filters = [myGlowFilter]; mc.exp_bar.filters = [myGlowFilter];
//Creates new text formats. var healthcurrent_fmt:TextFormat = newTextFormat(); var expcurrent_fmt:TextFormat = newTextFormat(); var mana_fmt:TextFormat = newTextFormat(); var health_fmt:TextFormat = newTextFormat(); var exp_fmt:TextFormat = newTextFormat(); var idbinfo_fmt:TextFormat = newTextFormat(); var manacurrent_fmt:TextFormat = newTextFormat();
idbinfo_fmt.align = "center"; //Creates new text fields. var manacurrent:TextField = mc.createTextField("manacurrent", 2001, 10, 6, 100, 20); var healthcurrent:TextField = mc.createTextField("healthcurrent", 2002, 10, 21, 100, 20); var expcurrent:TextField = mc.createTextField("expcurrent", 2003, 10, 36, 100, 20); var mana:TextField = mc.createTextField("mana", 2004, 187, 8, 100, 20); var health:TextField = mc.createTextField("health", 2005, 180, 23, 100, 20); var exp1:TextField = mc.createTextField("exp1", 2006, 195, 38, 100, 20); var idbinfo:TextField = idb.createTextField("idbinfo", 2007, 0, 45, 200, 40); //Sets the type of text field; Static, Dynamic, Input.
//Sets the text to a specific value or variable. mana.text = "Mana"; manacurrent.text = ""; healthcurrent.text = ""; expcurrent.text = ""; health.text = "Health"; exp1.text = "Exp"; idb.idbinfo.text = "Welcome to GUI beta"; //This applys the formats to the text fields. mana.setTextFormat(mana_fmt); manacurrent.setTextFormat(manacurrent_fmt); healthcurrent.setTextFormat(healthcurrent_fmt); expcurrent.setTextFormat(expcurrent_fmt); health.setTextFormat(health_fmt); exp1.setTextFormat(exp_fmt); idbinfo.setTextFormat(idbinfo_fmt); //This creates the text under the item database for information on examine, use, drop and what ever else. //This creates the Item database background image. idb.attachMovie("itemdb_bg", "idb_bg", 1, {_x:0, _y:0}); //This creates the 14 item slots and moves them into position for(var z = 0; z<9; z++){ idb.createEmptyMovieClip("is0"+(z+1), (z+2)); } for(var w = 9; w<14; w++){ idb.createEmptyMovieClip("is"+(w+1), (w+2)); }
//this creates a marker to show the current item action selected idb.attachMovie("item_selector", "item_selector", 21, {_x:0, _y:0});
//this code turns the highlighter invisible to start with. idb.item_selector._alpha = 23; idb.item_selector.blendMode = 9; idb.item_selector._visible = false; //Causes a run once function clearInterval(guiint); } //Runs guiInt guiint = setInterval(function(){ guiInt(); }, 1); function maUpdater(){ //Short form for the level0 player stats array; var l = _level0; /*this code updates the mana so that the current mana is never more than the total mana. A preventive measure.
_level0.currentmanavar is the current mana points _level0.totalmanavar mana total points */ if(l.currentmanavar>l.totalmanavar){ l.currentmanavar = l.totalmanavar; } x1 = 1513*(l.currentmanavar/l.totalmanavar); gui.mahpxp.mana_bar._xscale = x1; gui.mahpxp.manacurrent.text = l.currentmanavar+" / "+l.totalmanavar; trace(x1); clearInterval(maupdater); } function hpUpdater(){ //Short form for the level0 player stats array; var l = _level0; /*this code updates the mana so that the current health is never more than the total health. A preventive measure.
_level0.currenthealthvar is the current health points _level0.totalhealthvar health total points */ if(l.currenthealthvar>l.totalhealthvar){ l.currenthealthvar = l.totalhealthvar; } x1 = 1513*(l.currenthealthvar/l.totalhealthvar); gui.mahpxp.health_bar._xscale = x1; gui.mahpxp.healthcurrent.text = l.currenthealthvar+" / "+l.totalhealthvar; trace(x1); clearInterval(hpupdater); } function xpUpdater(){ //Short form for the level0 player stats array; var l = _level0; /*this code updates the mana so that the current experience is never more than the total experience. A preventive measure.
and i added an output to the code (not in the above).
Basically this is what it does
Arrays being created...
Arrays: CREATED
Setting up initial variables
Variables: Initilized
Creatinng Gui main function
Gui main function: CREATED
Creating Mana Uploader
Mana Uploader: Created
Creating hp Uploader
Hp Uploader: Created
Creating Xp Uploader
Xp Uploader: Created
Creating: Item Updater
Item Updater: Created
Run Gui function
Run maUpdater function
Run hpUpdater function
Run xpUpdater function
Run itemUpdater function
Creating gui movieclip
creating stats movieclip
creating itemdatabase movieclip
creating stat bars
creating text fields
Creating item database slots (movie clips)
creating item action buttons
Creating item action highlighter
updating mana on call
updating health on call
updating xp on call
updating database on call
ataching item to a slot
ataching item to a slot
creating item action onPress functions
Last edited by brickhouse420; 12-20-2010 at 02:48 PM.
The code works perfect, and is exactly how i want it to work. its great!
But, it's only 18% becaus i have like 50 other features i need to add to it, but where it stands it works fine. And I think it's optimized well
The code works perfect, and is exactly how i want it to work. its great!
But, it's only 18% becaus i have like 50 other features i need to add to it, but where it stands it works fine. And I think it's optimized well
Sorry ! I didn't understand your purpose about 18% . Now all is OK !
Thanks a lot ,