A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5828 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


Random Links | Add your own Flash Related Links
Flash Tutorials 1280 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» Unknown Tag: Title10
Random Tutorial | Add Site

Trading Customer Accounting (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories JavaScript Pop-up windows (no external scripts) in Flash - a definitive guide
Author: Jeffrey F. Hill | Website: http://www.flash-db.com |

 
Page 5
«prev 1 2 3 4 5 6 next»

Adding custom text, message's, and Links to your Popup window with JavaScript + PHP

This is where we get a little bit more technical and use a little bit of PHP - The php used in this example is so simple though that you should be able to convert it over to ASP or CFM with little or no experience in either. Please note that PHP or any other server side scripting language is not needed before this section. And can be avoided all together with the document.write function in JavaScript.

Here's the basic code used when we open the popup window:

on (release) {
getURL ("javascript:NewWindow=window.open('ShowPopup.php?customName=Jeff&customLink=http://www.flashkit.com&
customMessage=This is my Custom Message','newWin','width=400,height=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,
status=No,resizable=No,fullscreen=No');  NewWindow.focus();     void(0);");
}

The part in red is the only part where changing from the original 'basic' code. What where doing here is attaching variables onto the end of the URL string. Then we embed the Flash movie in a php page (which is the same as html, with the exception that we can add scripting to it). The PHP file would contain the following code in any part before we embed the movie:

<?
if ($customName || $customLink || $customMessage) {
$Attach = "?customName=$customName&customLink=$customLink&customMessage=$customMessage";
}
else {
$Attach = "";
}
?>

What this does is to grab the variables indicated with a preceding $ sign from the URL - then put them into a format we can attach onto the end of the SWF embed tags. The $Attach variable is used to store all of them.

The embed code for the Flash movie would then look like this:


<? print"$Attach";?>">


<? print"$Attach";?>"
 quality=high bgcolor=#0066CC  WIDTH=820 HEIGHT=640 TYPE="application/x-shockwave-flash"
 PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">

The most important part of the above embed code is indicated in Red. This will just print out the variables that we earlier defined with the $Attach variable onto the end of the flash movie. These variables will automatically be declared in the movie. Theirfor all you have to do to the Flash movie in order to see your custom text is to create a dynamic text field named for example 'customName' or 'customMessage'. For the link to work all you need to do after this is to create a button and add the following code:

on (release) {
 getURL (customLink, "_blank");
}

The red part indicates the variable you attached to the Flash movie in the embed code.

And that's about it. You can actually create some fairly advanced applications with all these mentioned procedures and functions.

«prev 1 2 3 4 5 6 next»

» Level Intermediate

Added: : 2002-01-09
Rating: 8.81 Votes: 149
Hits: 2300
» Author
Jeffrey Hill is a freelance web developer from Boulder, Colorado. He specializes in creating and developing dynamic database driven Flash content and applications. Specialty's include SQL, PHP, Perl, and XML.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs