Flashadvisor logo
:: Desktop Shortcut
:: Flash Help
Advices from Experts

 Submit Here! · Link to Us · Newsletter · Tell a Friend ·

      Add Tutorial |

 

Advertise here










 

Google

Search WWW   
FlashAdvisor.com

 Home > Tutorials  > Dynamic Content

Content Manager Flash and PHP

Author: T.Norman | Email
Website : www.ntdesigns.net


Advertisement

This tutorial will show you how to create an external admin panel to modify content of a Flash movie without the need to edit an .fla file. There are several intermediate to advanced methods that will be covered, so a moderate understanding of Flash and Actionscript is presumed.




Requirements:
Macromedia Flash MX or higher.
A web server that supports PHP.

Methods Used:
LoadVars
sendAndLoad
localConnection
button events

This method can be used to externally modify any content in a Flash movie, but for ease of demonstration, I will limit this demo to text editing. What we will be creating is a news reader that can be updated from an external administration movie. No need to modify an .fla or text file. The admin does all of that for you. Lets get started.....

Main Movie
Open a new Flash movie. The first thing to do is create the textfields that will display the information. The information will be presented as two pieces of data, "title" and "article". Create a dynamic textfield on the stage with the dimensions of width=400, height=300. Give this textfield an instance name of "article".Create another dynamic textfield with the dimensions of width=400, height=20 and place it above the article textfield. Give this textfield an instance name of "title". Rename the layer that the textfields reside on "textFields". Insert a new layer into the main timeline. Name this layer "scrollbar". Open the components menu from the "windows" menu option and drag a scrollbar onto the stage. Open the properties panel and for the Target textfield, type in "article". Now all that is left to do is provide the actionscript for the movie. Insert a new layer into the main timeline and label it "actions". I commented on what each section of code does, so for now, just paste this onto the first frame of the actions layer...


//Create a loadVars object to hold the data
articleData = new LoadVars();
//Process the data when it is loaded
articleData.onLoad = function() {
article.htmlText = this.article;
title.htmlText = this.title;
}
//Create a function to load the data that can be called remotely
myLoad = function () {
//load the data when called remotely
articleData.load("http://yoursite.com/saveAndLoad.txt");
}
//load the data to start
articleData.load("http://yoursite.com/saveAndLoad.txt");
//Create the local connection object for the admin movie
myLocalConnection = new LocalConnection();
//When the connection call is recieved, repopulate the loadVars object
myLocalConnection.onReceive1 = function() {
myLoad();
}
//Listen for the local connection from the admin movie
myLocalConnection.connect("incoming Message");


Create a new folder and save this movie as "NewsReader" In the next section, we will build the administration interface.

Download Source File

| 1 | 2 |

Rate This Tutorial :
We hope the information helped you. If you have any questions or comments, please don't hesitate to post them on the Forums section
Submit your Tutorial at Click Here
  

Home | About Us | Contact Us | Feedback | Advertise with us

Best viewed in 800x600 resolution with Internet Explorer.

Site Developed and Hosted by  ethicsolutions.com
All rights reserved with FlashAdvisor

Flash is a registered trademark of Adobe Systems, Inc.

29 users online