A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Please Help w/ Simple Action

  1. #1
    Fo Shizzle nubian niht's Avatar
    Join Date
    Oct 2000
    Posts
    212

    Please Help w/ Simple Action

    i have a newsletter.

    i have a button with this code.
    Code:
    on(release){
    	message = "submitting...";
    	this.loadVariables("newsletter.php","post");
    }

    i have an mc w/ this:

    Code:
    onClipEvent(load) {
    	this.gotoAndStop(1);
    }
    
    on(rollOver) {
    	this.gotoAndPlay("s1")
    }
    
    on(rollOut) {
    	this.gotoAndPlay("s2");
    }
    
    on (release) {
    	message = "submitting...";
    	this.loadVariables("newsletter.php","post");
    }
    the button w/ the code works (submits email for newsletter subscription) but not the mc.
    can someone please help and explain to me why?
    thanks in advance

  2. #2
    Fo Shizzle nubian niht's Avatar
    Join Date
    Oct 2000
    Posts
    212
    i've also tried:
    Code:
    submit_news.onRelease = function(){
    	message = "Sending...";
    	this.loadVariables("newsletter.php","post");
    };
    	
    submit_news.onRollOver = function() {
    	this.gotoAndPlay("s1")
    };
    
    submit_news.onRollOut = function() {
    	this.gotoAndPlay("s2")
    };
    this too does not work.
    please help

  3. #3
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Could you post the .fla? I will have a look at it.
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  4. #4
    Fo Shizzle nubian niht's Avatar
    Join Date
    Oct 2000
    Posts
    212
    i do not have the fla file with me.
    it is in school.

    the scene is very very simple.

    i have three layers:

    layer 1: textbox (for subscribing to the newsletter)

    layer 2: button which is comprised of this:
    Code:
    on(release){
    	message = "submitting...";
    	this.loadVariables("newsletter.php","post");
    }
    layer 3: mc w/ button action
    on one i have a textbox

    the button on layer 2 executes properly.
    but the mc on layer (which is what i want to use for this purpose) doesn't work.
    which is comprised of this:
    Code:
    onClipEvent(load) {
    	this.gotoAndStop(1);
    }
    
    on(rollOver) {
    	this.gotoAndPlay("s1")
    }
    
    on(rollOut) {
    	this.gotoAndPlay("s2");
    }
    
    on (release) {
    	message = "submitting...";
    	this.loadVariables("newsletter.php","post");
    }

  5. #5
    Hey Timmy!!! walsher's Avatar
    Join Date
    Jan 2005
    Location
    Latrobe, PA
    Posts
    1,899
    Howdy,
    With your problem your correct on the onCLipEvent but the others are only used on buttons. Meaning that they only work with button symbols. If you want to use the button type actions on a movie you should put them on the maintime. First make a new layer called actions. An then inside of it put this,
    code:
     _root.onEnterFrame =function(){
    mc name.onRollOver = function() {
    mc name.gotoAndPlay("s1")
    }

    mc name.onRollOut = function() {
    mc name.gotoAndPlay("s2");
    }

    mc name.onRelease = function() {
    message = "submitting...";
    this.loadVariables("newsletter.php","post");
    }
    }


  6. #6
    FK Newb Beater
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    676
    On what Scope do the variable to be posted exist? "this.loadVariables" on your submit_news MC assumes that all the variables exist on it's scope like submit_news.var1 = "email", submit_news.var2 = "address" etc.
    If the vars do not exist in the MovieClip Object, your code will appear to be broken, but what is happening is that you are not sending any data to the PHP script.
    Just because you changed the code, doesn't mean it's yours

    Most Recent Work:
    Commercial tanning beds website

  7. #7
    Fo Shizzle nubian niht's Avatar
    Join Date
    Oct 2000
    Posts
    212
    sorry for the late reply.
    i was able to get it top work by doing this:

    Code:
    on (release) {
    	message = "Sending...";
    	this._parent.loadVariables("newsletter.php","post");
    }
    i do appreciate all of your help.
    thank you

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