Por ejemplo mira.. en "Functions.as" tengo..
Código:
I me gustaria hacer algo tipo..package com.darkmagic.game { public class Functions { function Functions() {} public function Remplaze(Search:String, Remplaze:String, ForString:String):String { var temp_array = ForString.split(Search); var new_cadena = ""; for (var k = 0; k<temp_array.length; k++) { new_cadena += temp_array[k]+""+Remplaze; } new_cadena = new_cadena.substring(0, new_cadena.length-Remplaze.length); return new_cadena; } } }
Código:
Para usar la funcion "Remplaze" que esta dentro de "Functions.as".package com.darkmagic.login { import flash.display.MovieClip; import flash.events.*; import com.darkmagic.game.Functions; public class Preload extends MovieClip { function Preload():void { this.addEventListener(Event.ENTER_FRAME, Loading); } function Loading(e:Event):void { var Total:Number = this.stage.loaderInfo.bytesTotal; var Loaded:Number = this.stage.loaderInfo.bytesLoaded; var Progress:Number = Math.floor((Loaded*100)/Total); MovieClip(root)._game_loadinggame.text = Remplaze("$i", Progress+"%", MovieClip(root).gameLanguage.Get("_gamepve_login.preload.loadinggame")); MovieClip(root)._mc_loadinggame._mc_bar.x = Math.floor((Progress*562.0)/100); if(Total == Loaded) { this.removeEventListener(Event.ENTER_FRAME, Loading); gotoAndStop("game_login"); } } } }
No se si me explico.. Un saludo!