Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-14-2005, 08:15 PM   #1
jpmad4it
Registered User
 
Join Date: Mar 2005
Posts: 16
Default single preloader(s) for DB content & other questions

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]);
}
}
};
l.load(f);
}
gotoAndPlay(3);


//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) {
gotoAndPlay(85);
}

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

on(release){
gotoAndPlay(85);
}

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 :-)

Last edited by jpmad4it; 03-14-2005 at 10:28 PM.
jpmad4it is offline   Reply With Quote
Old 03-15-2005, 05:01 PM   #2
jpmad4it
Registered User
 
Join Date: Mar 2005
Posts: 16
Default

no one got any ideas at all??
jpmad4it is offline   Reply With Quote
Old 05-24-2005, 03:23 PM   #3
slim.chrisp
Registered User
 
Join Date: Jan 2005
Posts: 18
Default

how did you load images stored in the database?
slim.chrisp is offline   Reply With Quote
Old 05-24-2005, 08:16 PM   #4
hiphopconnect
Registered User
 
Join Date: Apr 2005
Posts: 18
Red face

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?

------------------------------------------------------------------

for this what I would do is create dynamic text that read HTML and have php send data as HTML that will create hyperlinks if you want a paragraph/sentence with hyperlinks make the whole sentence dynamic and treat it as HTML blah blah

------------------------------------------------------------------

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) {
gotoAndPlay(85);
}

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

on(release){
gotoAndPlay(85);
}

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

How can i get this to work????

------------------------------------------------------------------
if you changed the movie clip to a button and told it to go to frame 85 buttons only have 4 frames you would have more luck if created a square object made it a button and change the alpha to 0 and put the button under the movie clip
------------------------------------------------------------------

If you figured it out sorry just trying to help or if you had any better ideas
hiphopconnect is offline   Reply With Quote
Old 05-25-2005, 10:32 AM   #5
jpmad4it
Registered User
 
Join Date: Mar 2005
Posts: 16
Default

hey there,

no i never figured it out. ill try the suggestions and see what happens :-) thanks
jpmad4it is offline   Reply With Quote
Old 05-25-2005, 11:21 AM   #6
cxn926
no
 
cxn926's Avatar
 
Join Date: Mar 2005
Posts: 719
Default

USE AS TAGS. DONT YOU SEE THAT.

Don't forget to use ActionScript Tags!
ActionScript tags will automatically format your ActionScript code to be more legible. This will make it easier for people to understand your code and make them much more likely to help you!
To use ActionScript tags, simply enclose your ActionScript code in a pair of
ActionScript Code:
and
tags, as follows:

ActionScript Code:
trace("Test");
cxn926 is offline   Reply With Quote
Old 05-25-2005, 05:18 PM   #7
jpmad4it
Registered User
 
Join Date: Mar 2005
Posts: 16
Default

Quote:
Originally Posted by cxn926
USE AS TAGS. DONT YOU SEE THAT.

Don't forget to use ActionScript Tags!
ActionScript tags will automatically format your ActionScript code to be more legible. This will make it easier for people to understand your code and make them much more likely to help you!
To use ActionScript tags, simply enclose your ActionScript code in a pair of
ActionScript Code:
and
tags, as follows:

ActionScript Code:
trace("Test");
you mean when you post a topic put the code in tags???
jpmad4it is offline   Reply With Quote
Old 05-25-2005, 05:22 PM   #8
jpmad4it
Registered User
 
Join Date: Mar 2005
Posts: 16
Default

you mean like this:

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:

ActionScript Code:
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:

ActionScript Code:
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.:

ActionScript Code:
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:

ActionScript Code:
//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]); } } }; l.load(f); } gotoAndPlay(3); //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:

ActionScript Code:
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:

ActionScript Code:
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:

ActionScript Code:
onClipEvent (mouseUp) { gotoAndPlay(85); }

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

ActionScript Code:
on(release){ gotoAndPlay(85); }

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 :-)
jpmad4it is offline   Reply With Quote
Old 06-02-2005, 11:47 PM   #9
jpmad4it
Registered User
 
Join Date: Mar 2005
Posts: 16
Default

Quote:
Originally Posted by hiphopconnect
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?

------------------------------------------------------------------

for this what I would do is create dynamic text that read HTML and have php send data as HTML that will create hyperlinks if you want a paragraph/sentence with hyperlinks make the whole sentence dynamic and treat it as HTML blah blah

i have done this already - the text is displayed - but its all as one huge chunk - how can i get SINGLE WORDS as hyperlinks, not just the whole paragraph?


Quote:
Originally Posted by hiphopconnect
------------------------------------------------------------------

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) {
gotoAndPlay(85);
}

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

on(release){
gotoAndPlay(85);
}

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

How can i get this to work????

------------------------------------------------------------------
if you changed the movie clip to a button and told it to go to frame 85 buttons only have 4 frames you would have more luck if created a square object made it a button and change the alpha to 0 and put the button under the movie clip
------------------------------------------------------------------
thank you soooo much this one worked :-)
jpmad4it is offline   Reply With Quote
Old 06-03-2005, 12:25 AM   #10
cxn926
no
 
cxn926's Avatar
 
Join Date: Mar 2005
Posts: 719
Default

Quote:
Originally Posted by jpmad4it
you mean like this:

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:

ActionScript Code:
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:

ActionScript Code:
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.:

ActionScript Code:
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:

ActionScript Code:
//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]); } } }; l.load(f); } gotoAndPlay(3); //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:

ActionScript Code:
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:

ActionScript Code:
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:

ActionScript Code:
onClipEvent (mouseUp) { gotoAndPlay(85); }

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

ActionScript Code:
on(release){ gotoAndPlay(85); }

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 :-)
yes thank you for your understanding
cxn926 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:31 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.