art-d-sign
-


Hinweise


Thema geschlossen
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 20.10.2007, 17:25   #1
TP-Member
 
Registriert seit: Nov 2005
hups macht alles soweit korrekt

hilfe bei positionierung von Button


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 _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 _loc1 2);
            
image._x Math.round(160 image._width 2);
        } 
// end if
    
}
    else if (
scaleMode == "double" && (_loc2 metaWidth && _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 _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 _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 playagain.symbol._width 2;
    
playagain.symbol._y playagain.bg._height playagain.symbol._height _loc1 2;
    
playagain._y Math.round(120 playagain._height _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 startplaying.symbol._width 2;
    
startplaying.symbol._y startplaying.bg._height startplaying.symbol._height 2;
    
startplaying._y Math.round(120 startplaying._height _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 >= && _loc1 <= duration)
    {
        
ns.seek(_loc1);
    } 
// end if
// End of the function
function moveSoundhead()
{
    var 
_loc1 gui.snd._xmouse gui.snd.vol._x;
    if (
_loc1 <= || _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