A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: knowing the button that you click.

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    knowing the button that you click.

    well I'm having a hard time finding the words to discribe this. I know it can be done and may have been brought up but I didn't know what keywords to look for so here I am.

    I want to have buttons that when I click on it i can say something like this:
    Code:
    on (press) {
     _root.somefunction(this);
    }
    So I want it to send the name of the button either instance name or what ever to the function that will be sending that to a PHP script.
    Any help would be apretiated. I know this works:
    Code:
    on (press) {
    _root.someFunction("someName");
    }
    but I want to load the buttons dynamiclly and don't want to have to go in to flash and type "someName" you know

  2. #2
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    you want to send the button name to the function?
    Code:
    on (press) {
    	_root.someFunction(this._name);
    }

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    D'Oh!

    See I knew it would be easy, Thank you!. Can you tell I'm a noob

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    109

    Ok still not working

    Ok I tried this code:


    Code:
    //Frame actions: 
    
    function loadText (btn) {
    	if (btn == "VON") {
    		
    loadVarsText = new loadVars();
    loadVarsText.load("Somewebsite");
    loadVarsText.load("Somewebsite");
    loadVarsText.onLoad = function(success) {
    	if (success) {
    		trace("done loading");
    		teamText.text = this.VONTeam;
    	} else {
    		trace("not loaded");
    	}
    };
    	}else{
    		trace("Failed");
    	}
    }
    
    //Button actions
    
    on (release) {
    	_root.loadText(this._name); // This button is named VON in the library and also the instance name.
    }
    Of corse this is not working or I wouldn't be here. Thank you for helping .

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