6 Replies Latest reply on May 1, 2009 8:48 AM by IlyaG

    How do I change button skin with function arguments?

    IlyaG Level 1

      Hi guys, I am building a map witch I represent with buttons grid 40*26, now I wont to create a function in action script that will get a string that contains the folder name where I am storing the buttons skin data for example:

       

      [Embed("maps/grass/upSkin.jpg")]

      private var _upSkin:Class;

      [Embed("maps/grass/overSkin.jpg")]

      private var _overSkin:Class;

      [Embed("maps/grass/downSkin.jpg")]

      private var _downSkin:Class;

       

      private function changeMap():void

      {

           slot:Button=new Button();

           slot.setStyle("upSkin",test);

           slot.setStyle("overSkin",_overSkin);

           slot.setStyle("downSkin",_downSkin);

      }

       

      This is what I managed to do up to now, what I would like to do is to send to changeMap() a string with the path name, but some how I can't embed a variables, I will be glade if you could find a solution for that.

       

      This is the link for my site, so you can see what I am talking about. I am not always online but you can try.

       

      http://gazmanwars.zapto.org/

       

      *Best view under 1280*960 rez