newbie actionscript questions

  • jpmad4it
  • Novice
  • Novice
  • jpmad4it
  • Posts: 25

Post 3+ Months Ago


hi everyone

i am building my flash site using server side scripts i.e PHP/MySQL database.

Now i have figured out how to display content from my DB into my flash movie, even images!! Whoo i am good - joke

Anyway, my questions are as follows:

QUESTION 1: can i add separate pre-loaders for the content being loaded from the DB i.e. images, text, or is there a way to make 1 pre-loader for all the DB content and only display it once its ALL been loaded, as many little pre-loaders might look a bit silly. How is this done - code please i'm struggling here!!!!!!! Its just when my content loads up at the moment, 1 image pops up and then a bit of text at the top etc and it looks pretty rubbish - i want it all to be pre-loaded and then load up all at once.

QUESTION 2: i have managed to create a motion tween for the images (which are loaded using the following code within a loop:
n.htmlText += imageHolder_home.loadMovie (this["Image"+e]);

now i wish to create a motion tween for the text content too, at the moment its just displayed as dynamic text using the following code in the same loop as above:

n.htmlText += this["Content"+e];

ive tried converting the dynamic text field to movie symbols, and using the same syntax as for the images i.e.:

n.htmlText += contentHolder_home.loadMovie (this["Content"+e]);

but it just wont work? Is it possible to use my text from the DB in a motion tween? How is it done?!?

this is the full code incase you dont understand my description above:

//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function home(l, n, t, e, f) {
//create a new loadVars object if one doesn't already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = "";
if (t == content_home1) {
n.htmlText += this["Content"+e];
} if (t == content_home2){
n.htmlText += this["Content2"+e];
if (t == content_home3){
n.htmlText += this["Content3"+e];
if (t == imageHolder_home1){
n.htmlText += imageHolder_home1.loadMovie (this["Image"+e]);
if (t == imageHolder_home2){
n.htmlText += imageHolder_home2.loadMovie (this["Image2"+e]);
if (t == imageHolder_home3){
n.htmlText += imageHolder_home3.loadMovie (this["Image3"+e]);

//calls the lv function to display content
//this allows us to take different parts of the info from the DB and place it where we want
//we can even call from different php files
//for the content entry textfield
home(content_lv, content_home1, content_home1, 0, "Home.php");
//for the content2 textfield
home(content2_lv, content_home2, content_home2, 0, "Home.php");
//for the content3 textfield
home(content3_lv, content_home3, content_home3, 0, "Home.php");
//for the image holder
home(imageholder1_lv, imageHolder_home1, imageHolder_home1, 0, "Home.php");
//for the image2 holder
home(imageholder2_lv, imageHolder_home2, imageHolder_home2, 0, "Home.php");
//for the image3 holder
home(imageholder3_lv, imageHolder_home3, imageHolder_home3, 0, "Home.php");

PS would there be a simplify this funtion? i have to create 2 new lots of code when i wish to display just one item from the DB whether its text or an image:

one lot of text in the loop:

if (t == imageHolder_home3){
n.htmlText += imageHolder_home3.loadMovie (this["Image3"+e]);

and another to call the function for that particluar text field or image placeholder:

home(imageholder3_lv, imageHolder_home3, imageHolder_home3, 0, "Home.php");

it just seems very long-winded or is does this look ok to you guys? i dont know im a beginner :-(

PROBLEM 3: Another problem is with the imageHolder_home3.loadMovie image holders ive been using - in my flash editor i've just used a plain rectangle and converted it to a symbol with a top-left registration point. The thing is, they dont represent the real width and height dimensions of the actual image - if i set the imageholder to the real dimensions my picture is distorted when its displayed?? Its weird. It seems to take a hell of a lot of faffing around to get my images located where i want them to be, and its the same with the text too. Is there a secret to getting this right? If i could 'see' the images in the actual Flash editor i could create the correct size text fields and imageholders around them, but i cant so im kind of guessing at the moment and its taking ages to get it correct.

PROBLEM 4 - is it possible to create hyperlinks on single words dragged out of the database - my content is stored in a longtext field and so i dont think this can be done, can it?

PROBLEM 5 - once i have loaded an image to the loadMovie object, i tried to add the follwoing actionscript to it, but it does not work:

onClipEvent (mouseUp) {

i changed the symbol to a button and added this code:


now, the image does NOT display but the code works.

How can i get this to work????

so many questions but i bet you guys can help

thanks in advance to anyone who helps me out

Johnny (newbie!!!!)

just ask if you need the flash file and ill attach it :-)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 21 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.