• 0

Adobe Animate - help me make a button that calls a php function using jQuery


Question

I'm gonna give the folks at Adobe forum a break ๐Ÿ˜› I've been hounding them for half a year now, with GREAT success.. however when I asked my last question, it seems to have tired them out. Your turn Neowin! BTW this is literally the LAST thing that needs to be fixed. Any help appreciated.

OK Here it is... This is a canvas project. All I need to do is have my button call on the following php file as shown below:
(the file is called  SendEcard php)  (note that I didn't put my real url in the example, i'm not ready to go public)

<? 
register_globals( 'NGPCFRES' );

$CreateEcard = date(U); 
$filename = $CreateEcard.".txt"; 
$ToEmail = $_POST["ToEmail"]; 
$FromEmail = $_POST["FromEmail"]; 
$ToName = $_POST["ToName"]; 
$FromName = $_POST["FromName"]; 
$Greeting = $_POST["Greeting"]; 
$IntroMessage = $_POST["IntroMessage"]; 
$EndMessage = $_POST["EndMessage"]; 
$EcardSelect = $_POST["selected"]; 
$Today = (date ("l dS of F Y ( h:i:s A )",time())); 
$Created = "Ecard Created on $Today"; 
$EcardNum = $_POST['EcardSelect'];
$EcardText = "ToName={$_POST['ToName']}&ToEmail={$_POST['ToEmail']}&FromName={$_POST['FromName']}&FromEmail={$_POST['FromEmail']}&Greeting={$_POST['Greeting']}&IntroMessage={$_POST['IntroMessage']}&Created={$_POST['Created']}&"; 
$fp = fopen( "dBText/$filename","w"); 
fwrite($fp, $EcardText, 10000); 
fclose( $fp ); 
######Email Card######## 
## You can change the subject and the message part around. 
## Make sure to change the Link as stated in the Tutorial. 
## (Change from 'someSite' to your actual site - leave the rest the same 
$ToSubject = "E-card from $FromName"; 
$Message = "$ToName,\nYou have recieved a Flash E-card from $FromName. \nClick the following link to view your card:\n\n http://www.MYSITE.net/SelectCard.php?EcardText=$CreateEcard&ENum=$EcardNum\n\n-----------------------------------\nHere is the message that was sent:\n$ToName,\n$Greeting\n$IntroMessage\n\n-$FromName\n\n\n-----------------------------------\nThis card was sent by Bunny and Panda\n\nMaking you smile a little more each time."; 

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FromName." <".$FromEmail.">"); 

## This next line returns a success message to the movie. 
print "_root.holder.Status=\n Copy the following link to view your card:\n http://www.MYSITE.net/SelectCard.php?EcardText=$CreateEcard%26ENum=$EcardNum\n"; 

function register_global_array( $sg ) {
    Static $superGlobals    = array(
        'e' => '_ENV'       ,
        'g' => '_GET'       ,
        'p' => '_POST'      ,
        'c' => '_COOKIE'    ,
        'r' => '_REQUEST'   ,
        's' => '_SERVER'    ,
        'f' => '_FILES'     ,
        'n' => '_SESSION'
    );
    Global ${$superGlobals[$sg]};
    foreach( ${$superGlobals[$sg]} as $key => $val ) {
        $GLOBALS[$key]  = $val;
    }
}
function register_globals( $order = 'gpc' ) {
    $_SERVER;       //See Note Below
    $_ENV;
    $_REQUEST;
    $order  = str_split( strtolower( $order ) );
    array_map( 'register_global_array' , $order );
}
?>

 

In flash, all this php file did was read the values of my input text fields and print them to an e-mail and also generate a randomly numbered txt file which the e-card later reads the values and prints to its own dynamic text fields.

 

In Canvas, this is obviously going to be much different. I don't even know where to begin... should the above php be creating a js file instead of txt? And would the e-card simply load this js file as an external script and run it so that the js can tell the e-card's dynamic text what to display? Sounds about right, but again...I don't know how to do this :(


The php file itself does have a few.. quirks.. that probably need to be changed to work with the canvas (js). The line print "_root holder Status= etc....  I guess has to be changed to:

window.parent.this.holder.Status.text = "etc... stuff";

(This is only a wild guess, maybe someone out there knows)... the Status is a dynamic text field that exists in an iframe called iframe0, hope that helps with the confusion of me using window.parent...?

 

FINALLY...
In flash, for input text fields, using the above php code works fine, hence the current: 

 $ToEmail = $_POST["ToEmail"];


In canvas, I have to refer to input text component as: $('#FromName'), so does that mean the above php has to change to reflect this? (if so, what's the correct change I should use in my php?
And that's my question x)  See how simple a function can be asked in such a complicated manner by a noob? ๐Ÿ˜ข yeah the demise of Flash really really hurt me...

1 answer to this question

Recommended Posts

  • 0

This topic was automatically locked because it did not receive any replies for a year. If you want to have this topic reopened

  • please contact any staff moderator or
  • report the first post of the topic with the reason why it should be reopened.

Thank you.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I have the Pixel 9 Pro XL...Unless this thing is "leaps and bounds" faster than the 9, I'll pass. And by leaps and bounds, I don't mean on benchmarks. "Real world" faster. Most people don't even come close to topping out the performance of their phones. Tensor G5 is Google's most powerful chip to date, boasting a staggering 36 percent performance leap over G4.
    • MIT's stunning 'bubble wrap' device squeezes water out from thin air even in deserts by Sayan Sen Image by Matteo Roman via Pexels Massachusetts Institute of Technology (MIT) engineers have built a new kind of device that can pull clean drinking water straight out of the airโ€”no electricity needed. Itโ€™s designed for areas where water is scarce and traditional sources like rivers or lakes arenโ€™t reliable. Right now, more than 2.2 billion people globally donโ€™t have access to safe drinking water. In the United States alone, 46 million face water insecurity, with either no running water or water thatโ€™s not safe to drink. This new device, called an Atmospheric Water Harvesting Window (AWHW), uses a unique hydrogel panel that looks like black bubble wrap. These dome-shaped bubbles soak up water vapor from the air, especially at night when humidity is higher. During the day, sunlight makes the vapor inside evaporate. That vapor then condenses on a glass surface and drips down through a tube, turning into drinkable water. The AWHW doesnโ€™t rely on power sources like batteries or solar panels. Itโ€™s completely passive, meaning it works on its own. The team tested a meter-sized panel in Death Valley, California, one of the driest places in North America, and got between 57.0 and 161.5 milliliters of water per day even with humidity as low as 21 percent. Thatโ€™s more than what other similar passive devices have managed. โ€œWe have built a meter-scale device that we hope to deploy in resource-limited regions, where even a solar cell is not very accessible,โ€ said Xuanhe Zhao, a professor at MIT. โ€œItโ€™s a test of feasibility in scaling up this water harvesting technology. Now people can build it even larger, or make it into parallel panels, to supply drinking water to people and achieve real impact.โ€ Another cool part of the design is how they kept the water safe to drink. Usually, these kinds of hydrogels use salts like lithium chloride to absorb more vapor but that can lead to salt leaking into the water, which isnโ€™t ideal. To solve this, MITโ€™s team mixed in glycerol, a compound that helps keep salt locked inside the gel. In testing, the lithium ion concentration in the harvested water stayed below 0.06 ppm (parts per million), which is way below the safe limit. The hydrogel domes also give the material more surface area, letting it collect more vapor. The outer glass panel is coated with a special polymer film that helps cool the glass, making it easier for vapor to condense. โ€œThis is just a proof-of-concept design, and there are a lot of things we can optimize,โ€ said lead author Chang Liu, now a professor at the National University of Singapore. โ€œFor instance, we could have a multipanel design. And weโ€™re working on a next generation of the material to further improve its intrinsic properties.โ€ Published in Nature Water, the study says the AWHW could last at least a year and shows promise for making safe, sustainable water in places with harsh climates. The researchers believe an array of vertical panels could one day supply water to individual households, especially in remote or off-grid locations. Source: MIT News, Nature This article was generated with some help from AI and reviewed by an editor. Under Section 107 of the Copyright Act 1976, this material is used for the purpose of news reporting. Fair use is a use permitted by copyright statute that might otherwise be infringing.
    • Clear Linux is open source, indeed, so its source code is available for anyone. They're just shutting down its support from them, they're not forbidding anyone else from taking over.
    • Linux Mint is also my favorite distro, but I fear what will happen with it if Clem were to disappear tomorrow, to be honest.
    • Yeah, I totally get your point, which is possible it could happen. I just hope there is a few people around him who are similar to where if they took over things would run pretty much the same. if not, then yeah, it could start to decline rapidly etc. but I figure something that's been around for a longer period of time with a decent backing, and probably more users than most Linux distro's (which I would 'imagine' Mint is one of the more used Linux desktop distro's by volume of people who use it), is less likely to just disappear. but like you said, nothing is guaranteed. but I do think you are probably right in that Clem is probably the core of what keeps Mint, Mint. I like how it tends to stay pretty much the same with some slight tweaks here and there (but is largely the same) instead of that crap some people go for with change for the sake of change trying to create a overly fancy interface and other unnecessary stuff etc. I also feel Mint keeps a nice balance of things out-of-the-box where it's not too bloated, nor too striped down. p.s. but I see Mint as a better Ubuntu basically. but I get your point like if it was more of a really serious choice of needing a 'safe bet' to use long term, then yeah something like official Ubuntu would be one of the better choices for sure given what you said with it being backed by an actual company which makes it a safer bet than Mint which is smaller and 'could' potentially be more fragile.
  • Recent Achievements

    • First Post
      leoniDAM earned a badge
      First Post
    • Reacting Well
      Ian_ earned a badge
      Reacting Well
    • One Month Later
      Ian_ earned a badge
      One Month Later
    • Dedicated
      MacDaddyAz earned a badge
      Dedicated
    • Explorer
      cekicen went up a rank
      Explorer
  • Popular Contributors

    1. 1
      +primortal
      505
    2. 2
      ATLien_0
      209
    3. 3
      Michael Scrip
      202
    4. 4
      Xenon
      144
    5. 5
      +FloatingFatMan
      121
  • Tell a friend

    Love Neowin? Tell a friend!