[RESOLVED] button event from notepad or xml
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [RESOLVED] button event from notepad or xml

  1. #1
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84

    resolved [RESOLVED] button event from notepad or xml

    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 ?
    maybe I'm old, but I want to learn more

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    what script you want to change from txt / xml...............?

    arkitx

  3. #3
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    i prefer the xml

    can you help me sir

    i really need this script
    maybe I'm old, but I want to learn more

  4. #4
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    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

  5. #5
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    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
    maybe I'm old, but I want to learn more

  6. #6
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    Create a MovieClip name "button" and Linkage Class name "AS2Button".

    PHP Code:
    class AS2Button extends MovieClip {
        private static var 
    _logic:Boolean;
        private static var 
    btn:MovieClip;
        public function 
    AS2Button(target) {
            
    btn target.attachMovie("button"nulltarget.getNextHighestDepth());
            
    btn.txt.text "Button";
        }
        public function 
    get logic() {
            var 
    = 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";
        }

    Usage: Timeline Code

    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

  7. #7
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    would you mind give me the fla sample sir ?

    if you dont mind
    maybe I'm old, but I want to learn more

  8. #8
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    have a look.
    Attached Files Attached Files

  9. #9
    Member
    Join Date
    Feb 2012
    Location
    Nanggroe Aceh Darusalam
    Posts
    84
    it work sir, thank you very much

    this thread is resolved
    maybe I'm old, but I want to learn more

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com