PDA

View Full Version : [AS MX?] php promo spots and other crazyness



jcrash
November 10th, 2005, 11:51 AM
ok a client directed me to www.maranathachapel.org to take a look at their promo spot/rollover thing and their little music player which is on the bottom left corner. At first I thought yeah no problem I can do something similar to that. The promo is just a rollover and the music player is just a like a simple jukebox. But then as I looked closer and realized that the load times were insanely quick and their was an interval fade between the promos, but you could still do the rollovers etc...

I'm not sure how to do it so I fired up Gordon and tried to see what was going on. Well it's alot of AS1 and configured for Flash Player 6.

Here's just a sampling of the AS:


function replay_video() {
var local1 = _root;
set_first_banner_to_video();
featuretimer.reset_timer();
getURL(local1.lv.banner1, "/b1");
function () {
lc = new LocalConnection();
lc.send("music_control", "control_music", "off");
}
NULL[local1] = setInterval(200, "music_off_interval_replay");
local1.after_first_banner = function () {
local1 = _root;
lc = new LocalConnection();
lc.send("music_control", "control_music", "on");
local1.set_first_banner_to_image();
video_so = SharedObject.getLocal("flash_promo");
video_so.data["saw_video_" + local1.lv.banner1 + local1.lv.url1] = video_so.data["saw_video_" + local1.lv.banner1 + local1.lv.url1]++;
};
local1 = UNDEFINED;
}
function set_first_banner_to_video() {
var local1 = _root;
first_banner_is_video = true;
timer_first_banner_secs = 26;
reshow_first_banner = false;
video_mode = true;
local1.after_first_banner = function () {
local1 = _root;
lc = new LocalConnection();
lc.send("music_control", "control_music", "on");
local1.set_first_banner_to_image();
video_so = SharedObject.getLocal("flash_promo");
video_so.data["saw_video_" + local1.lv.banner1 + local1.lv.url1] = video_so.data["saw_video_" + local1.lv.banner1 + local1.lv.url1]++;
};
}
function set_first_banner_to_image() {
first_banner_is_video = false;
timer_first_banner_secs = 4;
reshow_first_banner = true;
}
set_first_banner_to_image();
String.prototype.replace = function (replaceString, withString) {
var local1 = this.split(replaceString);
return local1.join(withString);
};
lc_res = new LocalConnection();
lc_res.control_res = function () {
clearInterval(_root.music_off_interval);
clearInterval(_root.music_off_interval_replay);
};
lc_res.connect("control_music_res");
timer_other_banner_secs = 8;
framerate = 21;
stop();

Now I know AS2 pretty decent, I get lost on AS1 sometimes and to be honest I don't know alot about shared Objects and php kind of stuff. I was wondering if anybody had any ideas how to do this but still be extremely quick with it. It does not have to be dynamic like this site, just fast.