A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: email button help

  1. #1
    Senior Member
    Join Date
    Mar 2011
    Location
    Riverside ish...
    Posts
    173

    email button help

    I have a button embedded in a movie clip and need to to send to an email address... for some reason it does not work...

    Actionscript Code:
    var emailLink:URLRequest = new URLRequest("mailto:[email protected]");

    this.add_MC.youradd_but.addEventListener(MouseEvent.CLICK,emailClick);

    function emailClick(event:MouseEvent):void
    {
        navigateToURL(emailLink);
    }

    what am i doing wrong?

    Ive tired

    Actionscript Code:
    add_MC.youradd_but.addEventListener(MouseEvent.CLICK,emailClick);

    also.

  2. #2
    Senior Member
    Join Date
    Mar 2011
    Location
    Riverside ish...
    Posts
    173
    ok yall ive been working at this, and I really cant figure out how to make flash send an email...

    here is the script


    Actionscript Code:
    import flash.utils.*;
    import flash.events.*;

    var CurrentAdd = 1;
    var tempnum1;
    var maxadds = 3;
    var myTimer:Timer = new Timer(300,20);
    myTimer.addEventListener(TimerEvent.TIMER,someFunction);
    myTimer.start();
    add_MC.youradd_but.addEventListener(MouseEvent.CLICK,emailClick);

    function someFunction(event:TimerEvent)
    {
        trace(String((20-myTimer.currentCount)));
        if (myTimer.currentCount == 20)
        {
            myTimer.reset();
            tempnum1 = randomNumber(1,maxadds);
            if (tempnum1 == CurrentAdd)
            {
                tempnum1 +=  1;
                if (tempnum1 >= maxadds)
                {
                    tempnum1 -=  2;
                }
                add_MC.gotoAndPlay(tempnum1);
                CurrentAdd = tempnum1;
            }
            else
            {
                add_MC.gotoAndPlay(tempnum1);
                CurrentAdd = tempnum1;
            }
            myTimer.start();
        }
    }

    function randomNumber(low:Number=0, high:Number=1):Number
    {
        return Math.floor(Math.random() * (1+high-low)) + low;
    }

    function emailClick(event:MouseEvent):void {
        var url:String = "mailto:[email protected]";
    var request:URLRequest = new URLRequest(url);
    try {
      navigateToURL(request, '_blank'); // second argument is target
    } catch (e:Error) {
      trace("Error occurred!");
    }
    }


    nothing happens when I do a local test... I figured it would at least give me a pop up...

    do I need to upload it to the server in order to just see if my email scrip worked?




    ********EDIT*************

    ok for some reason my event listeners are not working... I added a trace to the function to see if when i clicked the button anything was even happening, and no it seems as if it was not.
    Last edited by YBAB; 04-07-2011 at 12:39 PM.

  3. #3
    Senior Member
    Join Date
    Mar 2011
    Location
    Riverside ish...
    Posts
    173
    ok since no one has replied I am forced to upload the FLA...

    this is an flash banner engine, I need to have the buttons embedded in the add_MC to actually interact when clicked...

    I feel dumb I cant get them to work, as I have tried so many different things...

    Odd thing is I have this functioning on one of my other FLAs and it is structured the exact same way...

    please please please someone help me...

    http://www.filedropper.com/addengine_1

  4. #4
    Senior Member
    Join Date
    Mar 2011
    Location
    Riverside ish...
    Posts
    173
    bump bump bump bump...


    for the love of god, yall answer questions on the craziest stuff... this is something simple someone please take some time to take a look through this scrip and help me out... this is driving me crazy and I have no other steps to take to figure out what to do now...

    This is highly important because this is for a paying client, and I am freaking out because I have made this work in every single other one of my flash files but for some reason this one is different.


    BUMP BUMP BUMP

    PLEASE HELP!

  5. #5
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    Your email link with the URLRequest looks fine. The problem is probably something that has to do with the way you set up the MouseEvent.CLICK.

    Are the names of the movieclips in your timeline the same as what you're calling? If you say
    Code:
    this.add_MC.youradd_but
    from the main timeline, then at that frame there has to be a movieclip called add_MC in its properties window, and then inside that, on the frame you're looking at there has to be another clip called youradd_but, also named that in its properties. If you want to post the FLA file here, go ahead. The link you're giving is bad, it just goes to the filedropper homepage.
    The Strike Agency
    http://www.theStrikeAgency.com

    StrikeSapphire -- The Original Bitcoin Casino
    https://strikesapphire.com
    (not available in the US)

  6. #6
    Senior Member
    Join Date
    Mar 2011
    Location
    Riverside ish...
    Posts
    173
    tight thanks josh this has been driving me crazy...

    im pretty sure my name associations are right, but ill double check!

    www.completelylegal.tv/addengine.fla


    if you help me figure this out I will love you long time... and actually have a couple more questions for you, if you feel like making a few dollars!

  7. #7
    Senior Member
    Join Date
    Mar 2011
    Location
    Riverside ish...
    Posts
    173
    bump

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