Hello all,
First I would like ot think anyone for taking the time to read my post, and let anyone know that I am not trying to get others to do my work. I will/have read about what I am asking, but I am not exactly sure what direction to take next. With that disclaimer out of the way
As a newbe to Flash, I am trying to have a simple swf with a static background image that will have phrases at random locatoin slowly fade in, stay for a few seconds, and then fade out. Then the next phrase, and the next one, and then next one, until it loops arround again. The phrases are coming from a database, and I have already created my asp code to give me a page with &phrase=phrase1,phrase2,phrase3,…&status=1&. My fla file has two layers–one for the background and the other for a movie clip wich contains a dynamic text field. My first frame loads my variables, and my second frame looks to see if status equals 1 (the last variable being loaded). If status is not equal 1, I send the head back to frame 1, otherwise I split the phrases into an array, get the height and width of the swf, and init a count var to 0.
//Look for a way to test the number of times the loop back to frame 1
//has been doen so that we can set a time out. Additionally, maybe put
//logic in the system to test for a blank services?
if (_root.status == 1) {
Services_Array = Services.split(",");
//Need to get this value here, because the size is returned with any
//part hanging off the sides, so the text box could be off the end
Scene_Width = _root._width;
Scene_Height = _root._height;
count = 0;
} else {
gotoAndPlay(1);
}
From here things get a little cloudy, in frame 3 of my second layer I would like to calculate a random postion for the phrase, so far I have:
Services_Clip.Services_Text._alpha = 0;
set ("Services_Clip.Services_Text", Services_array[count]);
Text_Width = Services_Text.textWidth;
Text_Height = Services_Text.textHeight;
Text_X = Math.random() * (Scene_Width - Text_Width);
Text_Y = Math.random() * (Scene_Height - Text_Height);
setProperty ("Services_Clip", _x, Text_X);
setProperty ("Services_Clip", _y, Text_Y);
However, many parts of that code does not work. I broke the math stuff up so that I could see the values in debug. Anyhow, Text_Width and Text_Height are undefined, which causes Text_X and Text_Y to be calculated for positions that may put the text off screen? Additionally, I have seen some very nice code on this forum that fades stuff in and out using event function, so should I be headed that way?
I am sorry for such a long post, and really really appricate anyone taking their time to help me out.
Thanks,
Jimmy Puckett