SWiSH Forum
Forum użytkowników programów SWiSH

SWiSH Max - full screan / cały ekran / na maxa ... jak ??

sl01k - Wto 29 Sty, 2008 17:25
Temat postu: full screan / cały ekran / na maxa ... jak ??
http://ne.au.playstation.com/ps3gamesuniverse/
czyli jak zrobic taki fullscrean ??

był bym bardzo wdzieczny za odpowiedz :)

mielu - Wto 29 Sty, 2008 17:53

jest to taki gadżet jak na youtube, więc kiedyś natknąłem się na playera flv i do niego dołączony jest taki as
Kod:

/**
* Display user interface management of the players MCV pattern.
*
* @author    Jeroen Wijering
* @version    1.6
**/


import com.jeroenwijering.players.*;
import com.jeroenwijering.utils.*;


class com.jeroenwijering.players.DisplayView extends AbstractView {


    /** reference to the  imageloader object **/
    private var  imageLoader:ImageLoader;
    /** Reference to the currently active item **/
    private var currentItem;
    /** Reference to the currently active item **/
    private var itemSize:Array;
    /** Reference to the currently active item **/
    private var thumbSize:Array;
    /** Starting position of the players **/
    private var startPos:Array;


    /** Constructor **/
    function DisplayView(ctr:AbstractController,cfg:Object,fed:Object) {
        super(ctr,cfg,fed);
        Stage.addListener(this);
        itemSize = new Array(config['displaywidth'],config['displayheight']);
        thumbSize = new Array(config['displaywidth'],config['displayheight']);
        var ref = this;
        var tgt = config["clip"];
        imageLoader = new ImageLoader(tgt.display.thumb);
        imageLoader.onLoadFinished = function() {
            ref.thumbSize = new Array(this.targetClip._width,
                this.targetClip._height);
            ref.scaleClip(tgt.display.thumb,this.targetClip._width,
                this.targetClip._height);
        }
        startPos = new Array(tgt._x,tgt._y);
        setColorsClicks();
        setDimensions();
    };


    /** Sets up colors and clicks of all display items. **/
    private function setColorsClicks() {
        var ref = this;
        // background
        var tgt = config["clip"].back;
        tgt.col = new Color(tgt);
        tgt.col.setRGB(config["backcolor"]);
        // display items
        var tgt = config["clip"].display;
        tgt.setMask(config["clip"].mask);
        if(config["showicons"] == "false") {
            tgt.playicon._visible = false;
        }
        tgt.activity._visible = false;
        tgt.back.tabEnabled = false;
        if(config["linkfromdisplay"] == "true") {
            tgt.playicon._visible = false;
            tgt.back.onRelease = function() {
                ref.sendEvent("getlink",ref.currentItem);
            };
        } else {
            tgt.back.onRelease = function() {
                ref.sendEvent("playpause");
            };
        }
        if(config["logo"] != "undefined") {
            var lll = new ImageLoader(tgt.logo,"none");
            lll.onLoadFinished = function() {
                tgt.logo._x = ref.config["displaywidth"] -
                    tgt.logo._width - 10;
                tgt.logo._y = ref.config["displayheight"] -
                    tgt.logo._height - 10;
            };
            lll.loadImage(config["logo"]);
            tgt.logo.onRelease = function() {
                ref.sendEvent("getlink",ref.currentItem);
            };
        }
    };


    /** Sets up dimensions of all controlbar items. **/
    private function setDimensions() {
        var tgt = config["clip"].back;
        if(Stage["displayState"] == "fullScreen") {
            config["clip"]._x = config["clip"]._y = 0;
            tgt._width = Stage.width;
            tgt._height = Stage.height;
        } else {
            config["clip"]._x = startPos[0];
            config["clip"]._y = startPos[1];
            tgt._width = config["width"];
            tgt._height = config["height"];
            if(config["displayheight"] >= config["height"] -
                config['controlbar'] && config["displaywidth"] ==
                config["width"]) { tgt._height--; }
        }
        var tgt = config["clip"].display;
        scaleClip(tgt.thumb,thumbSize[0],thumbSize[1]);
        scaleClip(tgt.image,itemSize[0],itemSize[1]);
        scaleClip(tgt.video,itemSize[0],itemSize[1]);
        if(Stage["displayState"] == "fullScreen") {
            config["clip"].mask._width =
                tgt.back._width = Stage.width;
            config["clip"].mask._height =
                tgt.back._height = Stage.height;
        } else {
            config["clip"].mask._width =
                tgt.back._width = config["displaywidth"];
            config["clip"].mask._height =
                tgt.back._height = config["displayheight"];
        }
        tgt.playicon._x = tgt.activity._x = Math.round(tgt.back._width/2);
        tgt.playicon._y = tgt.activity._y = Math.round(tgt.back._height/2);
        if(Stage["displayState"] == "fullScreen") {
            tgt.playicon._xscale = tgt.playicon._yscale =
                tgt.activity._xscale = tgt.activity._yscale =
                tgt.logo._xscale = tgt.logo._yscale = 200;
            tgt.logo._x = Stage.width - tgt.logo._width - 20;
            tgt.logo._y = Stage.height - tgt.logo._height - 20;
        } else {
            if(config["largecontrols"] == "true") {
                tgt.playicon._xscale = tgt.playicon._yscale =
                    tgt.activity._xscale = tgt.activity._yscale = 200;
            } else {
                tgt.playicon._xscale = tgt.playicon._yscale =
                    tgt.activity._xscale = tgt.activity._yscale =
                    tgt.logo._xscale = tgt.logo._yscale = 100;
            }
            if(tgt.logo._height > 1) {
                tgt.logo._x= config["displaywidth"]-tgt.logo._width -10;
                tgt.logo._y= config["displayheight"]-tgt.logo._height-10;
            }
        }
    };


    /** Show and hide the play/pause button and show activity icon **/
    private function setState(stt:Number) {
        var tgt = config["clip"].display;
        switch(stt) {
            case 0:
                if (config["linkfromdisplay"] == "false" &&
                    config["showicons"] == "true") {
                    tgt.playicon._visible = true;
                }
                tgt.activity._visible = false;
                break;
            case 1:
                tgt.playicon._visible = false;
                if (config["showicons"] == "true") {
                    tgt.activity._visible = true;
                }
                break;
            case 2:
                tgt.playicon._visible = false;
                tgt.activity._visible = false;
                break;
        }
    };


    /** save size information and rescale accordingly **/
    private function setSize(wid:Number,hei:Number) {
        itemSize = new Array (wid,hei);
        var tgt = config["clip"].display;
        scaleClip(tgt.image,itemSize[0],itemSize[1]);
        scaleClip(tgt.video,itemSize[0],itemSize[1]);
    };


    /** Scale movie according to overstretch setting **/
    private function scaleClip(tgt:MovieClip,wid:Number,hei:Number):Void {
        var tcf = tgt.mc._currentframe;
        tgt.mc.gotoAndStop(1);
        if(Stage["displayState"] == "fullScreen") {
            var stw:Number = Stage.width;
            var sth:Number = Stage.height;
        } else {
            var stw = config["displaywidth"];
            var sth = config["displayheight"];
        }
        var xsr:Number = stw/wid;
        var ysr:Number = sth/hei;
        if (xsr < ysr && config["overstretch"] == "false" ||
            ysr < xsr && config["overstretch"] == "true") {
            tgt._width = wid*xsr;
            tgt._height = hei*xsr;
        } else if(config["overstretch"] == "none") {
            tgt._width = wid;
            tgt._height = hei;
        } else if (config["overstretch"] == "fit") {
            tgt._width = stw;
            tgt._height = sth;
        } else {
            tgt._width = wid*ysr;
            tgt._height = hei*ysr;
        }
        tgt._x = stw/2 - tgt._width/2;
        tgt._y = sth/2 - tgt._height/2;
        tgt.mc.gotoAndPlay(tcf);
    };


    /** Load Thumbnail image if available. **/
    private function setItem(idx:Number) {
        currentItem = idx;
        var tgt = config["clip"].display;
        if(feeder.feed[idx]["image"] == "undefined") {
            tgt.thumb.clear();
            tgt.thumb._visible = false;
        } else {
            imageLoader.loadImage(feeder.feed[idx]["image"]);
            tgt.thumb._visible = true;
        }
    };


    /** OnResize Handler: catches stage resizing **/
    public function onResize() {
        if(_root.displayheight > config["height"]+10) {
            config["height"] = config["displayheight"] = Stage.height;
            config["width"] = config["displaywidth"] = Stage.width;
        }
        setDimensions();
    };


    /** Catches fullscreen escape  **/
    public function onFullScreen(fs:Boolean) {
        if(fs == false) { setDimensions(); }
    };


}





a tu cała dokumentacja http://www.jeroenwijering...r#documentation

sl01k - Wto 29 Sty, 2008 17:58

pomocna z ciebie duszyczka.... juz wszysko wiem dzieki :)
mielu - Wto 29 Sty, 2008 17:59

jak CI się uda to podziel się tym na forum :)
sl01k - Wto 29 Sty, 2008 18:04

w tym momencie tego niepotrzebuje ale za tydzien do tego siade...
zazwyczaj na odpowiedz na tym forum troche sie czeka niespodziewalem sietak szybkiej reakcji ... i to celnej ... z tego co wyczytalem powinno dac sie to skleic z swishem ...
I LOVE JS

Grzesiek82 - Wto 05 Lut, 2008 15:07

^mielu z tym skryptem trochę zaszalałeś hehe mam coś prostszego :wink:
a wiec tak w kodzie html wrzucamy takie coś:
Kod:
allowFullScreen="true"

a w swishmaxie takie coś:
Kod:
Stage["displayState"] = "fullScreen"; //dla pełnego ekranu
Stage["displayState"] = "normal"; // powrót do normalnego widoku


jeszcze jedna informacja do w/w skryptów, działają one jedynie w 9 i wyższych wersjach Flash Playera

mielu - Wto 05 Lut, 2008 15:33

Grzesiek82 napisał/a:
mielu z tym skryptem trochę zaszalałeś hehe mam coś prostszego :wink:

troszkę

sl01k - Wto 05 Lut, 2008 16:16

pikne :) dzia
marcino - Wto 05 Lut, 2008 19:33

witam,
extra bajer :-D
a jak zrobić żeby jeszcze nie skalował animacji ?

pozdrawiam.

sl01k - Wto 05 Lut, 2008 19:46

to juz nieproblem
Kod:
onLoad () {
    Stage.scaleMode = "noScale";}

Grzesiek82 - Wto 05 Lut, 2008 19:52

lub
Kod:
fscommand("AllowScale","false");

:)

mro - Pią 08 Lut, 2008 14:27

a ja mam pytanie czy ten full screen działa wam pod IE bo mi nie....
może jakaś rada??
ps. jak usunąć suwaki w firefoxie?? da się wogóle?

Grzesiek82 - Pią 08 Lut, 2008 14:50

mro napisał/a:
a ja mam pytanie czy ten full screen działa wam pod IE bo mi nie....
u mnie w IE7 działa z tym, że zanim uruchomię flasha na stronie wyskakuje belka z informacja o pozwolenie na wykonanie java scriptu lub kontrolek ActiveX
mro napisał/a:
ps. jak usunąć suwaki w firefoxie?? da się wogóle?
o jakie suwaki ci chodzi ?
mro - Pią 08 Lut, 2008 14:53

suwaki strony html pod ie znikneły ale w ff nie :/
Piotr - Nie 21 Mar, 2010 10:25

Witam !!

No i poległem (od zawsze nie lubiałem html'a), czy ktoś będzie łaskaw "łopatologicznie" wskazać mi miejsce gdzie mam wpisać ten kawałek kodu
Kod:
allowFullScreen="true"
w poniższy fragment ?

Kod:
<body>
        <div id="flashcontent">
            <div id="content">
               
            </div>
            <div id="top">
                Do poprawnego działania tej strony wymagana jest wtyczka Adobe Flash Player oraz włączona obsługa

JavaScript.
                <br />
                <a class="link" href="http://www.adobe.com/go/getflash/">Pobierz wtyczkę</a>
                <br />
                <br />
                This site requires Adobe Flash Player and JavaScript in your browser.
                <br />
                <a class="link" href="http://www.adobe.com/go/getflash/">Get Flash Player</a>
            </div>
        </div>
        <script type="text/javascript">
            var so = new SWFObject("main.swf", "100%", "100%", "6", "#000000");
            so.addParam("scale", "noscale");
            so.write("flashcontent");
        </script>
    </body>


Pozdrawiam ... :-D=

Januszr - Nie 21 Mar, 2010 12:07

To nie html tylko jakieś byle java Swfobiekt, czy coś takiego ....
Cytat:
so.addParam("scale", "noscale")


Tak na chłopski rozum, bo się nei znam na objektach jawowych - te, to NoScale może warto na fullscreen?
a może
dodaj kolejną linię, którą zapewne napisałem błędnie, bo nie znam się, jednak sens powinieneś pojąć:
Cytat:
so.addparam("allowFullScreen", "true")


Powered by phpBB modified by Przemo © 2003 phpBB Group