Visualizzazione dei risultati da 1 a 5 su 5

Discussione: [AS3] forceSmoothing

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929

    [AS3] forceSmoothing

    ciao a tutti,

    un pò di tempo fà and80 mi scrisse una funzione in As2 adesso sto creando una classe in As3 e al suo interno ho riutilizzato la funzione, la classe funziona bene e anche la funzione (che ho modificato per As3)
    solo che mi restituisce un errore (apparentemente sembra non influire) vorrei capire di cosa si tratta

    la funzione è questa
    codice:
    		private function loadInit(t) {
    			try {
    				t.forceSmoothing = true; 
    				if ((stage.stageWidth / stage.stageHeight) > t.width/t.height) {
    					t.height = stage.stageWidth / (t.width/t.height);
    					t.width=stage.stageWidth;
    				} else {
    					t.width = stage.stageHeight / (t.height/t.width);
    					t.height=stage.stageHeight;
    				}
    				if (t.getBounds(t.parent).yMax<stage.stageHeight) {
    					t._y-=t.getBounds(t.parent).yMax-stage.stageHeight;
    				}
    				if (t.getBounds(t.parent).xMax<stage.stageWidth) {
    					t.x-=t.getBounds(t.parent).xMax-stage.stageWidth;
    				}
    			} catch (err) {
    				trace(err);
    			}
    		}
    l'errore è questo su forceSmoothing

    ReferenceError: Error #1056: Impossibile creare la proprietà forceSmoothing su flash.display.Loader.

    mentre se commento la righa //t.forceSmoothing = true; ricevo questo errore

    ReferenceError: Error #1069: Impossibile trovare la proprietà yMax su flash.geom.Rectangle e nessun valore predefinito presente.

    e la funzione a dire il vero sembra andar meglio...

    Grazie mille

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    per vedere la classe in azione posto il link
    clicca qui

    in questo modo si riescea vedere cosa deve fare la funzione

    NB: il menu è il tasto destro del mouse
    ops per vedere l'effetto dovreste ridimensionare il browser
    aspetto fiduciosa....

    Grazie

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    sorry in AS3 si usa
    codice:
    t.smoothing = true;
    solo che non capisco perche adesso mi da questo errore

    ReferenceError: Error #1056: Impossibile creare la proprietà smoothing su flash.display.Loader.

    anche se nel mio pacchetto importo queste classi
    codice:
    	import flash.display.*;
    	import flash.events.*;
    	import flash.net.URLRequest;
    	import flash.geom.*;
    	import com.greensock.*;
    	import flash.net.*;
    	import flash.text.*;
    	import flash.xml.*;
    	import flash.ui.*;


  4. #4
    devi fare il casting del content del loader come Bitmap, sulla quale puoi applicare lo smoothing.

    il tuo loader potrebbe caricare qualcos'altro, ad esempio un swf, per cui la proprietà smoothing non è detto sia applicabile.

    http://www.kirupa.com/forum/showthread.php?t=289874
    There is nothing conceptually better than Rock 'n' Roll.

    poker is very much like sex. most people think they're the best but don't know what they're doing.

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    grazie mille

    ma ricevo cmq un errore
    questo:
    ReferenceError: Error #1069: Impossibile trovare la proprietà yMax su flash.geom.Rectangle e nessun valore predefinito presente.

    codice:
    	private function loadInit(t) {
    		try {
    			t= Bitmap(MyMc.content);
    			t.smoothing = true; 
    			if ((stage.stageWidth / stage.stageHeight) > t.width/t.height) {
    				t.height = stage.stageWidth / (t.width/t.height);
    				t.width=stage.stageWidth;
    			} else {
    				t.width = stage.stageHeight / (t.height/t.width);
    				t.height=stage.stageHeight;
    			}
    			if (t.getBounds(t.parent).yMax<stage.stageHeight) {
    				t._y-=t.getBounds(t.parent).yMax-stage.stageHeight;
    			}
    			if (t.getBounds(t.parent).xMax<stage.stageWidth) {
    				t.x-=t.getBounds(t.parent).xMax-stage.stageWidth;
    			}
    		} catch (err) {
    			trace(err);
    		}
    	}

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.