can we put button event from notepad or xml
so we can change the button script without open the FLA file
anyone can help me ?
Printable View
can we put button event from notepad or xml
so we can change the button script without open the FLA file
anyone can help me ?
what script you want to change from txt / xml...............?
arkitx
i prefer the xml :)
can you help me sir :(
i really need this script
What I mean to say what is the content inside txt or xml file?
What button event you want to store inside of txt/xml file?
Specify more details what you need.
arkitx
basicly we use actionscript direct in button right ?
or we can put the script on frame action
now i wonder to know, can we put the button script to control specific button in flash from the xml or txt ?
just like load text from txt file, but now i need to control the button
Create a MovieClip name "button" and Linkage Class name "AS2Button".
Usage: Timeline CodePHP Code:
class AS2Button extends MovieClip {
private static var _logic:Boolean;
private static var btn:MovieClip;
public function AS2Button(target) {
btn = target.attachMovie("button", null, target.getNextHighestDepth());
btn.txt.text = "Button";
}
public function get logic() {
var f = function (n) {
_logic = n;
};
f.showName = f;
return f;
}
public function get _name() {
if (!_logic) {
return;
}
return btn._name;
}
public function set _name(str:String) {
btn._name = str;
}
public function get _x() {
return btn._x;
}
public function set _x(val) {
btn._x = val;
}
public function get _y() {
return btn._y;
}
public function set _y(val) {
btn._y = val;
}
public function onPress() {
btn.txt.text = "Pressed";
}
public function onRelease() {
btn.txt.text = "Released";
}
public function onRollOut() {
btn.txt.text = "Button";
}
}
PHP Code:
var my_btn = new AS2Button(this);
my_btn._x = 20;
my_btn._y = 20;
my_btn.logic.showName(false);//This true/false will come from xml or txt file
my_btn._name="MyButton";
trace(my_btn._name);
arkitx
would you mind give me the fla sample sir ?
if you dont mind
have a look.
it work sir, thank you very much :)
this thread is resolved