Für gecrackte SWF und Code gibt es hier kein Support und damit ist der Beitrag auch dicht.![]()
Hallo ich habe da ein flv player gefunden
http://oos.moxiecode.com/flvplayer/
nun möchte ich die Button an meine Bilder anpassen d.h die position ,
nur leider ist das teil etwas komplitiert für mich wer kann mir sagen wie ich die einzelnen steuerelemente in flash positionieren kann ohne x-y anzugeben im as ?
hier das script
PHP-Code:function scaleGui()
{
var _loc2 = 400;
var _loc3 = 190;
var _loc4 = (_loc3 - 208) / 2;
var _loc5 = (_loc2 - 528) / 2;
gui._x = Math.round(-_loc5);
if (hiddenGui)
{
gui._y = _loc3 - Math.ceil(_loc4);
gui.starty = gui._y;
}
else
{
gui._y = _loc3 - gui._height - Math.ceil(_loc4);
} // end else if
if (showPlaylistButton)
{
var _loc10 = 210;
if (!showScaleModes)
{
_loc10 = 191;
} // end if
}
else
{
_loc10 = 189;
if (!showScaleModes)
{
_loc10 = 170;
} // end if
} // end else if
if (!showScaleModes)
{
gui.setsize._visible = 0;
} // end if
widthTimeline = _loc2 - _loc10;
gui.bg._width = _loc2;
gui.timeline._width = widthTimeline;
gui.time._x = gui.timeline._x + widthTimeline + 6;
gui.snd._x = gui.timeline._x + widthTimeline + 61;
if (showPlaylistButton)
{
gui.setsize._x = gui.snd._x + gui.snd._width + 28;
gui.playlist._x = gui.snd._x + gui.snd._width + 8;
}
else
{
gui.setsize._x = gui.snd._x + gui.snd._width + 6;
gui.playlist._visible = 0;
} // end else if
gui.top._width = widthTimeline + 2;
gui.bot._width = widthTimeline + 2;
gui.right._x = gui.timeline._x + widthTimeline + 1;
//Rezise panel
sizemenu._x = Math.round(gui.setsize._x - _loc5 - 72);
sizemenu._y = Math.round(_loc3 - _loc4 - 199);
updateTimeline();
if (hiddenGui)
{
var _loc1 = 0;
}
else
{
_loc1 = gui._height;
} // end else if
if (scaleMode == "none" && (_loc2 > metaWidth && _loc3 - _loc1 > metaHeight))
{
flv._width = metaWidth;
flv._height = metaHeight;
flv._y = Math.round(120 - metaHeight / 2 - _loc1 / 2);
flv._x = Math.round(160 - metaWidth / 2);
image._xscale = 100;
image._yscale = 100;
if (startImage != undefined && image.getBytesTotal() > 512)
{
image._y = Math.round(120 - image._height / 2 - _loc1 / 2);
image._x = Math.round(160 - image._width / 2);
} // end if
}
else if (scaleMode == "double" && (_loc2 > metaWidth * 2 && _loc3 - _loc1 > metaHeight * 2))
{
flv._width = metaWidth * 2;
flv._height = metaHeight * 2;
flv._y = Math.round(160 - metaHeight - _loc1 / 2);
flv._x = Math.round(160 - metaWidth);
if (startImage != undefined && image.getBytesTotal() > 512)
{
image._y = Math.round(120 - image._height - _loc1 / 2);
image._x = Math.round(360 - image._width);
} // end if
}
else
{
var _loc8 = _loc2 / metaWidth;
var _loc9 = (_loc3 - _loc1) / metaHeight;
var _loc7 = metaHeight / metaWidth;
var _loc6 = metaWidth / metaHeight;
if (_loc8 < _loc9)
{
flv._height = _loc2 * _loc7;
flv._width = _loc2;
}
else
{
flv._width = (_loc3 - _loc1) * _loc6;
flv._height = _loc3 - _loc1;
} // end else if movie bild setzet
flv._y = Math.round(120 - flv._height / 2 - _loc1 / 2);
flv._x = Math.round(250 - flv._width / 2);
if (startImage != undefined && image.getBytesTotal() > 512)
{
if (scaleMode == "none")
{
image._xscale = 100;
image._yscale = 100;
}
else if (scaleMode == "double")
{
image._xscale = 200;
image._yscale = 200;
}
else
{
image._height = _loc2;
image._width = _loc2;
} // end else if
if (image._width >= _loc2 || image._height >= _loc3 - _loc1)
{
_loc8 = _loc2 / imageWidth;
_loc9 = (_loc3 - _loc1) / imageHeight;
_loc7 = imageHeight / imageWidth;
_loc6 = imageWidth / imageHeight;
if (_loc8 < _loc9)
{
image._height = _loc2 * _loc7;
image._width = _loc2;
}
else
{
image._width = (_loc3 - _loc1) * _loc6;
image._height = _loc3 - _loc1;
} // end if
} // end else if
image._y = Math.round(120 - image._height / 2 - _loc1 / 2);
image._x = Math.round(260 - image._width / 2);
} // end else if
} // end else if
playagain.bg._width = flv._width;
playagain.bg._height = flv._height;
playagain.symbol._x = playagain.bg._width / 2 - playagain.symbol._width / 2;
playagain.symbol._y = playagain.bg._height / 2 - playagain.symbol._height / 2 - _loc1 / 2;
playagain._y = Math.round(120 - playagain._height / 2 - _loc1 / 2);
playagain._x = Math.round(260 - playagain._width / 2);
if (startImage != undefined && image.getBytesTotal() > 512)
{
startplaying.bg._width = image._width;
startplaying.bg._height = image._height;
}
else
{
startplaying.bg._width = _loc2;
startplaying.bg._height = _loc3 - _loc1;
} // end else if
startplaying.symbol._x = startplaying.bg._width / 2 - startplaying.symbol._width / 2;
startplaying.symbol._y = startplaying.bg._height / 2 - startplaying.symbol._height / 2;
startplaying._y = Math.round(120 - startplaying._height / 2 - _loc1 / 2);
startplaying._x = Math.round(160 - startplaying._width / 2);
scalePlaylist();
} // End of the function
function updateTimeline()
{
streamed = 100 * (ns.bytesLoaded / ns.bytesTotal);
played = 100 * (ns.time / duration);
gui.streamed._width = Math.round(streamed * (widthTimeline / 100));
gui.played._width = Math.round(played * (widthTimeline / 100));
gui.playhead._x = Math.round(gui.played._x + gui.played._width - gui.playhead._width / 2);
var _loc1 = Math.floor(ns.time / 60);
var _loc2 = Math.round(ns.time - _loc1 * 60);
if (_loc1 < 10)
{
_loc1 = "0" + _loc1;
} // end if
if (_loc2 < 10)
{
_loc2 = "0" + _loc2;
} // end if
var _loc4 = _loc1 + ":" + _loc2;
gui.time.text = _loc4 + "/" + totTime;
if (!autoStart || totTime == undefined)
{
gui.time.text = "00:00/00:00";
} // end if
if (Math.ceil(played) >= 100 && !isNaN(played) && !videoPaused && !waitForLoad)
{
if (jsCallback && fileType != "xml")
{
getURL("javascript:flvEnd()");
} // end if
if (loop && fileType != "xml")
{
ns.seek(0);
}
else if (fileType == "xml")
{
if (playlistPlayingId < playlistArray.length - 1)
{
waitForLoad = true;
clickPlaylist(playlistPlayingId + 1);
}
else if (loop)
{
waitForLoad = true;
clickPlaylist(0);
}
else
{
playagain._visible = 1;
playPauseVideo();
gui.playpause.onRelease = restartVideo;
if (jsCallback)
{
getURL("javascript:flvEnd()");
} // end else if
} // end else if
}
else
{
playagain._visible = 1;
playPauseVideo();
gui.playpause.onRelease = restartVideo;
} // end else if
} // end else if
if (playagain._visible)
{
gui.played._width = gui.timeline._width;
gui.playhead._x = Math.round(gui.played._x + gui.played._width - gui.playhead._width / 2);
} // end if
if (hiddenGui && guiActive)
{
var _loc3 = getTimer();
if (_loc3 > lastMouseMove + 1500)
{
hideGui();
} // end if
} // end if
} // End of the function
function movePlayhead()
{
gui.playpause.onRelease = playPauseVideo;
playagain._visible = 0;
var _loc3 = gui._xmouse - gui.streamed._x;
var _loc2 = _loc3 / widthTimeline * 100;
var _loc1 = _loc2 * duration / 100;
if (_loc1 >= 0 && _loc1 <= duration)
{
ns.seek(_loc1);
} // end if
} // End of the function
function moveSoundhead()
{
var _loc1 = gui.snd._xmouse - gui.snd.vol._x;
if (_loc1 <= 0 || _loc1 >= gui.snd.bg._width)
{
return;
} // end if
var _loc2 = Math.round(_loc1 / gui.snd.bg._width * 100);
changeVolume(_loc2);
} // End of the function
function init()
{
trace ("init");
delete _root.onEnterFrame;
flv._visible = 0;
playagain._visible = 0;
startplaying._visible = 0;
gui.streamed._width = 0;
gui.played._width = 0;
gui._visible = 1;
scaleGui();
changeVolume(defaultVolume);
setupSizeMenu();
setSmoothing();
if (!autoStart)
{
gui.playpause.onRelease = startplaying.onRelease;
loadImage();
playPauseVideo();
videoPaused = true;
return;
} // end if
loading._visible = 0;
videoPaused = false;
gui.playpause.gotoAndStop(1);
gui.playpause.onRelease = playPauseVideo;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
flv.attachVideo(ns);
ns.setBufferTime(buffer);
ns.play(flvToPlay);
ns.onMetaData = function (obj)
{
metaWidth = obj.width;
metaHeight = obj.height;
duration = obj.duration;
var _loc2 = Math.floor(duration / 60);
var _loc3 = Math.round(duration - _loc2 * 60);
if (_loc2 < 10)
{
_loc2 = "0" + _loc2;
} // end if
if (_loc3 < 10)
{
_loc3 = "0" + _loc3;
} // end if
totTime = _loc2 + ":" + _loc3;
scaleGui();
flv._visible = 1;
if (jsCallback)
{
getURL("javascript:flvStart(\'" + metaWidth + "\',\'" + metaHeight + "\')", "");
} // end if
if (startTime != undefined && startTime != 0)
{
startTime = Number(startTime);
if (startTime > duration)
{
startTime = duration;
} // end if
if (startTime < 0)
{
startTime = 0;
} // end if
ns.seek(startTime);
} // end if
waitForLoad = false;
image._visible = 0;
if (_root.onEnterFrame == undefined)
{
trace ("setting EF");
_root.onEnterFrame = updateTimeline;
} // end if
};
if (hiddenGui)
{
guiActive = false;
this.gui.onMouseMove = checkGui;
} // end if
} // End of the function
function loadImage()
{
if (startImage == undefined)
{
loading._visible = 0;
startplaying._visible = 1;
return;
} // end if
image.loadMovie(startImage);
image._visible = 0;
this.onEnterFrame = checkImageLoading;
} // End of the function
function checkImageLoading()
{
var _loc2 = 100 * (image.getBytesLoaded() / image.getBytesTotal());
if (_loc2 >= 100 && image.getBytesTotal() > 512)
{
imageWidth = image._width;
imageHeight = image._height;
loading._visible = 0;
startplaying._visible = 1;
scaleGui();
image._visible = 1;
delete this.onEnterFrame;
} // end if
} // End of the function
function restartVideo()
{
if (fileType == "xml")
{
clickPlaylist(0);
}
else
{
ns.seek(0);
playPauseVideo();
} // end else if
playagain._visible = 0;
gui.playpause.onRelease = playPauseVideo;
} // End of the function
function playPauseVideo()
{
if (!videoPaused)
{
gui.playpause.gotoAndStop(2);
videoPaused = true;
}
else
{
gui.playpause.gotoAndStop(1);
videoPaused = false;
} // end else if
if (videoPaused)
{
ns.pause(true);
}
else
{
ns.pause(false);
} // end else if
} // End of the function
function changeVolume(vol)
{
var _loc4 = new Sound(this._root);
_loc4.setVolume(vol);
defaultVolume = vol;
var _loc2 = Math.round(gui.snd.bg._width / 100 * vol);
gui.snd.sndhead._x = gui.snd.vol._x + _loc2 - gui.snd.sndhead._width / 2;
gui.snd.vol._width = _loc2;
gui.snd.icon.gotoAndStop(Math.round(_loc2 / 2));
} // End of the function
function showGui()
{
gui.goaly = gui.starty - gui._height;
this.gui.onEnterFrame = guiAnim;
guiActive = true;
} // End of the function
function hideGui()
{
gui.goaly = gui.starty;
this.gui.onEnterFrame = guiAnim;
guiActive = false;
hideSizeMenu(false);
hidePlaylist();
} // End of the function
function guiAnim()
{
var _loc2 = (this.goaly - this._y) / 2;
this._y = this._y + _loc2;
this._y = Math.round(this._y);
if (Math.round(this._y) == this.goaly)
{
this._y = this.goaly;
delete this.onEnterFrame;
} // end if
} // End of the function
function checkGui()
{
lastMouseMove = getTimer();
if (!guiActive)
{
showGui();
} // end if
} // End of the function
function writeError(msg)
{
error.htmlText = msg;
} // End of the function
function setupContextMenu()
{
var _loc2 = new ContextMenu();
var _loc5 = new ContextMenuItem("Toggle Fullscreen (Flash 9,0,18,60 or higher)", toggleFullscreen, true, true, true);
var _loc4 = new ContextMenuItem("FlvPlayer v 1.0, by", gotoOOS, true, false, true);
var _loc3 = new ContextMenuItem("http://oos.moxiecode.com/", gotoOOS, false, true, true);
_loc2.customItems.push(_loc5, _loc4, _loc3);
_root.menu = _loc2;
_loc2.hideBuiltInItems();
} // End of the function
function gotoOOS()
{
getURL("http://oos.moxiecode.com/", "_blank");
} // End of the function
// End of the function
function addGlow(clip)
{
var _loc3 = 7631989;
var _loc7 = 5.000000E-001;
var _loc5 = 4;
var _loc4 = 4;
var _loc6 = 2;
var _loc2 = 3;
clip.filter = new flash.filters.GlowFilter(_loc3, _loc7, _loc5, _loc4, _loc6, _loc2);
clip.filters = [clip.filter];
} // End of the function
function removeGlow(clip)
{
clip.filters = [];
} // End of the function
function setSmoothing()
{
flv.smoothing = smoothVideo;
} // End of the function
function setupSizeMenu()
{
var _loc3 = ["Smooth Video", "Original Size", "Double Size", "Fit to Window"];
for (var _loc2 = 0; _loc2 < 4; ++_loc2)
{
sizemenu["item" + _loc2].item_txt.text = _loc3[_loc2];
sizemenu["item" + _loc2].over._alpha = 0;
sizemenu["item" + _loc2].sel._visible = 0;
sizemenu["item" + _loc2].id = _loc2;
sizemenu["item" + _loc2].onRelease = function ()
{
clickSizeMenu(this.id);
};
sizemenu["item" + _loc2].onRollOver = function ()
{
this.over._alpha = 100;
};
sizemenu["item" + _loc2].onRollOut = sizemenu["item" + _loc2].onReleaseOutside = function ()
{
this.over._alpha = 0;
};
} // end of for
if (smoothVideo)
{
sizemenu.item0.sel._visible = 1;
} // end if
if (scaleMode == "none")
{
sizemenu.item1.sel._visible = 1;
} // end if
if (scaleMode == "double")
{
sizemenu.item2.sel._visible = 1;
} // end if
if (scaleMode == "aspect")
{
sizemenu.item3.sel._visible = 1;
} // end if
sizemenu._visible = 0;
sizemenu.onMouseDown = function ()
{
if (!this.hitTest(_xmouse, _ymouse, true) && !this._parent.gui.setsize.hitTest(_xmouse, _ymouse, true))
{
hideSizeMenu(false);
} // end if
};
} // End of the function
function clickSizeMenu(id)
{
if (id == 0)
{
if (smoothVideo)
{
smoothVideo = false;
}
else
{
smoothVideo = true;
} // end else if
setSmoothing();
} // end if
if (id == 1)
{
scaleMode = "none";
scaleGui();
} // end if
if (id == 2)
{
scaleMode = "double";
scaleGui();
} // end if
if (id == 3)
{
scaleMode = "aspect";
scaleGui();
} // end if
hideSizeMenu(true);
} // End of the function
function showSizeMenu()
{
sizemenu._visible = 1;
gui.setsize.onRelease = hideSizeMenu;
} // End of the function
function hideSizeMenu(bool)
{
if (bool)
{
setupSizeMenu();
} // end if
gui.setsize.onRelease = showSizeMenu;
sizemenu._visible = 0;
} // End of the function
function loadXML(url)
{
recXML = new XML();
recXML.ignoreWhite = true;
recXML.onLoad = parseXML;
recXML.load(url);
} // End of the function
function parseXML()
{
makeArray(recXML.firstChild);
delete recXML;
if (playlistArray.length > 1)
{
showPlaylistButton = true;
} // end if
playlistPlayingId = 0;
flvToPlay = playlistArray[playlistPlayingId][3];
startTime = playlistArray[playlistPlayingId][4];
init();
setupContextMenu();
setupPlaylist();
scalePlaylist();
playlist.con["item" + playlistPlayingId].cover._visible = 1;
playlist.con["item" + playlistPlayingId].enabled = false;
} // End of the function
function makeArray(node)
{
playlistArray = [];
for (var _loc2 = 0; _loc2 < node.childNodes.length; ++_loc2)
{
var _loc1 = node.childNodes[_loc2];
var _loc3 = _loc1.attributes.name;
var _loc6 = _loc1.attributes.length;
var _loc7 = _loc1.attributes.url;
var _loc4 = _loc1.attributes.thumbnail;
var _loc5 = _loc1.attributes.starttime;
playlistArray[_loc2] = [_loc3, _loc6, _loc4, _loc7, _loc5];
} // end of for
} // End of the function
function clickPlaylist(id)
{
playlist.con["item" + playlistPlayingId].cover._visible = 0;
playlist.con["item" + playlistPlayingId].enabled = true;
playlist.con["item" + playlistPlayingId].over._alpha = 0;
playlistPlayingId = id;
flvToPlay = playlistArray[id][3];
startTime = playlistArray[id][4];
init();
hidePlaylist();
playlist.con["item" + playlistPlayingId].cover._visible = 1;
playlist.con["item" + playlistPlayingId].enabled = false;
} // End of the function
function setupPlaylist()
{
playlist.con.item._visible = 0;
for (var _loc3 = 0; _loc3 < playlistArray.length; ++_loc3)
{
var _loc2 = playlist.con.item.duplicateMovieClip("item" + _loc3, _loc3);
_loc2._y = _loc3 * _loc2.over._height;
var _loc6 = playlistArray[_loc3][0];
_loc2.item_name.text = _loc6;
var _loc4 = playlistArray[_loc3][1];
if (_loc4 == undefined)
{
_loc4 = "--:--";
} // end if
_loc2.time.text = _loc4;
_loc2.url = playlistArray[_loc3][3];
_loc2.starttime = playlistArray[_loc3][4];
_loc2.id = _loc3;
_loc2.cover._visible = 0;
var _loc5 = playlistArray[_loc3][2];
if (_loc5 != undefined)
{
_loc2.thumb.loadMovie(_loc5);
} // end if
if (_loc3 == 0)
{
_loc2.line._visible = 0;
} // end if
_loc2.over._alpha = 0;
_loc2.onRelease = function ()
{
clickPlaylist(this.id);
};
_loc2.onRollOver = function ()
{
this.over._alpha = 100;
};
_loc2.onRollOut = _loc2.onReleaseOutside = function ()
{
this.over._alpha = 0;
};
} // end of for
playlistHeight = _loc3 * _loc2.over._height;
playlist.upbut.onRelease = function ()
{
scrollPlaylist(1);
};
playlist.upbut.onRollOver = function ()
{
this.gotoAndStop(3);
};
playlist.upbut.onRollOut = playlist.upbut.onReleaseOutside = function ()
{
this.gotoAndStop(2);
};
playlist.downbut.onRelease = function ()
{
scrollPlaylist(-1);
};
playlist.downbut.onRollOver = function ()
{
this.gotoAndStop(3);
};
playlist.downbut.onRollOut = playlist.downbut.onReleaseOutside = function ()
{
this.gotoAndStop(2);
};
playlist.pos = 0;
} // End of the function
function scrollPlaylist(dir)
{
if (playlist.scrolling)
{
return;
} // end if
playlist.goaly = playlist.con._y + playlist.con.item.over._height * dir;
playlist.pos = playlist.pos + dir;
playlist.onEnterFrame = doScrollPlaylist;
playlist.scrolling = true;
} // End of the function
function doScrollPlaylist()
{
var _loc2 = (this.goaly - this.con._y) / 2;
this.con._y = this.con._y + _loc2;
if (Math.round(this.con._y) == Math.round(this.goaly))
{
playlist.scrolling = false;
this.con._y = this.goaly;
delete this.onEnterFrame;
scalePlaylist();
} // end if
} // End of the function
function scalePlaylist()
{
playlist.con.setMask(playlist.msk);
var _loc1 = playlist.con.item.over._height;
var _loc4 = Math.floor((Stage.height - gui._height) / _loc1) - 1;
var _loc3 = Math.floor((Stage.height - gui._height) / _loc1 - 1) * _loc1;
if (_loc3 < _loc1)
{
_loc3 = _loc1;
} // end if
if (lastVisibleCount < _loc4)
{
playlist.pos = playlist.pos + 1;
} // end if
if (playlist.pos >= 0)
{
playlist.pos = 0;
} // end if
playlist.msk._height = _loc3;
var _loc2 = _loc3 + 18;
if (_loc3 > playlistHeight)
{
playlist.pos = 0;
_loc2 = playlistHeight + 18;
} // end if
playlist.con._y = 9 + _loc1 * playlist.pos;
playlist.bg._height = _loc2;
playlist.arrow._y = _loc2;
playlist.downbut._y = _loc2;
if (playlist.pos == 0)
{
playlist.upbut.enabled = false;
playlist.upbut.gotoAndStop(1);
}
else
{
playlist.upbut.enabled = true;
if (playlist.upbut._currentframe == 1)
{
playlist.upbut.gotoAndStop(2);
} // end if
} // end else if
if (_loc2 >= playlistHeight || _loc4 - playlist.pos >= playlistArray.length)
{
Für gecrackte SWF und Code gibt es hier kein Support und damit ist der Beitrag auch dicht.![]()
Gruß
Wanderratte
Gebildet ist,
wer weiß,
wo er findet,
was er nicht weiß.
4bugs
Home
Amazon Wunschzettel
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)