fashionbiz
Grünschnabel
Ich bin mit Flash und Javascript total Anfänger. Wohin müsste ich diesen Code einfügen - ins AS? - und woher bekomme ich das nötige Javascript Schnipsel?
Oder kann man dieses folgende JS anpassen ?
Oder kann man dieses folgende JS anpassen ?
Code:
var selected_idx = -1;
var selected_id = '';
var flash_ready = 0;
function ajaxfill(elemId,url,postFunction) {
var xmlHttp = false;
if (typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
if (!xmlHttp) {
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlHttp = false;
}
}
}
if (xmlHttp) {
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
var content = xmlHttp.responseText;
if (elemId) {
var elem = document.getElementById(elemId);
elem.innerHTML = content;
}
if (postFunction) {
postFunction(content);
}
}
};
xmlHttp.open('GET', url, true);
xmlHttp.send(null);
}
}
function showObject(id, idx, updateFlash) {
if (false) {
selected_idx = idx;
selected_id = id;
var url = 'None?id='+id;
ajaxfill('None', url, null);
var ids = Array();
var l = ids.length;
for (var i=0; i<l; i++) {
var curr = ids[i];
var elem = document.getElementById('link_'+curr);
if (curr == id) {
elem.className = 'faecher_active';
} else {
elem.className = 'faecher_inactive';
}
}
if (updateFlash && flash_ready==1) {
var fl = document.getElementById('flashobj');
if (!fl) {
var fls = document.getElementsByName('flashobj');
if (fls.length>0) {
fl = fls[0];
}
}
if (fl) {
fl.showImgByIndex(idx);
fl.pointImgByIndex(idx);
}
}
}
}
function hoverObject(id, idx, updateFlash)
{
var url = 'None?id='+id;
ajaxfill('None', url, null);
var ids = Array();
var l = ids.length;
for (var i=0; i<l; i++) {
var curr = ids[i];
var elem = document.getElementById('link_'+curr);
if (i == idx-1) {
elem.className = 'faecher_hover';
} else {
if (i == selected_idx-1) {
elem.className = 'faecher_active';
} else {
elem.className = 'faecher_inactive';
}
}
}
if (updateFlash && flash_ready==1) {
var fl = document.getElementById('flashobj');
if (!fl) {
var fls = document.getElementsByName('flashobj');
if (fls.length>0) {
fl = fls[0];
}
}
if (fl) {
fl.showImgByIndex(idx);
}
}
}
function unhoverObject(id, idx, updateFlash)
{
if (false) {
var elem = document.getElementById('link_'+id);
if (idx == selected_idx) {
elem.className = 'faecher_active';
} else {
elem.className = 'faecher_inactive';
}
if (updateFlash && flash_ready==1) {
var fl = document.getElementById('flashobj');
if (!fl) {
var fls = document.getElementsByName('flashobj');
if (fls.length>0) {
fl = fls[0];
}
}
if (fl) {
fl.hideImgByIndex(idx);
}
}
}
}
function initFlashImage() {
flash_ready = 1;
}