Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2005, 06:08 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default Introduction please

Hi,

I have written my webpage using standard html / PHP and a bit of java

Question: My server isn't compatible with *.cfm
but I can run *.fla and *.swf

I use PHP to access MySQL and display the informations + use some variables (Articles_ID) to send the "surfer" to the correct page. like:

<form name=<?php echo "button".$Article_ID." "; ?>
method="POST" action="Articles.php?ID=<?php echo "$Article_ID" ?>"><p align="center" style="margin-top: 0; margin-bottom: -19"><input type="submit" value="View" name="Articles"></form>

Can this be done in *.fla or *.swf ?

What I am after is a better look and I think Flash can provide ths easily (everything been relative..)
 
Old May 19th, 2005, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mantis
Yes this can be done, look into the LoadVars class. Below is a quick sample. The basic concept is create a LoadVars() object. When the user submits the form send the information to the server using the .load. From there you can determine when the server sends back a response using the onLoad and then use some code to determine where to send the using with a GetURL. Below is some code that I hope doesn't confuse you if it does post your questions and somebody will help.

Frame 1. -This would be your form page
stop();
var yourFormURL:String = "http://www.myDomain.com/myPHPCode.php";
var whereToGo:LoadVars = new LoadVars();

submit_btn.onRelease = function() {
    submitChoice();
};

function submitChoice() {
    var choice:Number = radioGroup.selectedData;
    poll.load(yourFormURL + "?formField1=" + choice);
    gotoAndStop("Waiting");
}

whereToGo.onLoad = returnedInfoLoaded;

function returnedInfoLoaded() {
    gotoAndStop("Display");
}

Frame 2-Waiting.
Frame with the words submitting choice....

Frame 3.
Mantis you would do something like this
    var whereToSendUser:Number = whereToGo.sendUserVarFromPHPPage;
    if (whereToSendUser < 5) {
        //send to somewhere
    } else {
        //send somewhere else
    }

Peace
Mike
http://www.eclecticpixel.com
http://www.homegrownmusicjam.com
 
Old May 19th, 2005, 10:39 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

a yes would have suffice :)

I just order: Dreamweaver MX: PHP Web Development
by Gareth Downes-Powell, Tim Green, Bruno Mairlot

Should make more sense after reading the book ;)




Similar Threads
Thread Thread Starter Forum Replies Last Post
Introduction: What's new in .NET 2.0 john_tempest BOOK: Professional C# 2005 with .NET 3.0 ISBN: 978-0-470-12472-7 0 July 20th, 2007 05:22 PM
Wrox Video: Introduction to JSON jminatel Javascript 0 January 1st, 2007 06:47 PM
Wish I had read the Introduction before I bought t OffByOne BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 October 12th, 2005 09:56 PM
Introduction to PHP FAQs richard.york PHP FAQs 0 April 3rd, 2004 07:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.