Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 38

Discussione: setTrasform

  1. #1

    setTrasform

    ho un cursore che va da 0 a 100 e dovrebbe cambiarmi il colore della clip: ho dato queata action ad una clip di controllo:

    onClipEvent (enterFrame) {
    mybg = new Color(_root.bgclip.bg);
    red100 = _root.nav.slide.cursore._x;
    red255 = parseInt((red100*255)/100);
    Mytransform = new Object();
    Mytransform.rb = red255;
    mybg.setTransform(Mytransform);
    }
    le 2 variabili le visualizzo in 2 dynamic text e funzionano, ma la clip non cambia colore, il percorso pare giusto, la clip si trova in un swf che carico nel primo fotogramma dentro la clip bgclip e ha nomeistanza bg, mi aiutate a capire perchè non funziona??

  2. #2
    Utente di HTML.it L'avatar di Stormy
    Registrato dal
    Dec 2000
    Messaggi
    2,701
    premettendo che non c'è bisogno di creare un oggetto color ad ogni enterframe, io facendo la prova l'ho messo nel movie clip in cui si carica il filmato esterno

    onClipEvent(data){
    _root.mybg = new Color(bg);
    }

    l'errore sta qua

    onClipEvent (enterFrame) {
    red100 = _root.nav.slide.cursore._x;
    red255 = parseInt((red100*255)/100);
    Mytransform = new Color();
    Mytransform.rb = red255;
    _root.mybg.setTransform(Mytransform);
    }

    mytransform deve essere un oggetto colore

    tieni presente che per funzionare cursore deve essere allineato bene all'interno di slide

  3. #3
    Grazie Stormy ora provo!!

  4. #4
    Ho potuto provarlo solo ora, ma continua a non funzionare!!
    ho modificato il cursore che va da -50 a 50 e ho dato questa action alla clip che carica il filmato dove c'e la clip bg:

    onClipEvent (data) {
    _root.mybg = new Color(bg);
    }
    onClipEvent (enterFrame) {
    red50 = _root.nav.slide.cursore50._x;
    red255 = parseInt((red50*255)/50);
    Mytransform = new Color();
    Mytransform.rb = red255;
    _root.mybg.setTransform(Mytransform);
    }

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    1,037
    codice:
    onClipEvent (data) {
    	_root.mybg = new Color(bg);
    }
    onClipEvent (enterFrame) {
    	red50 = _root.nav.slide.cursore50._x;
    	red255 = parseInt((red50 * 255) / 50);
    	Mytransform = new Object();
    	Mytransform.rb = red255;
    	_root.mybg.setTransform(Mytransform);
    }

  6. #6
    Originariamente inviato da Stormy
    mytransform deve essere un oggetto colore

    tieni presente che per funzionare cursore deve essere allineato bene all'interno di slide
    No. DEVE essere un Object generico, nono Color. Basta consultare la guida

    Usage

    myColor.setTransform(colorTransformObject);

    Parameters

    colorTransformObject An object created with the new Object constructor. This instance of the Object object must have the following properties that specify color transform values: ra, rb, ga, gb, ba, bb, aa, ab. These properties are explained below.

    Returns

    Nothing.

    Description

    Method; sets color transform information for an instance of the Color object. The colorTransformObject parameter is a generic object that you create from the new Object constructor. It has parameters specifying the percentage and offset values for the red, green, blue, and alpha (transparency) components of a color, entered in the format .

    The parameters for a color transform object correspond to the settings in the Advanced Effect dialog box and are defined as follows:

    • ra is the percentage for the red component (-100 to 100).
    • rb is the offset for the red component (-255 to 255).
    • ga is the percentage for the green component (-100 to 100).
    • gb is the offset for the green component (-255 to 255).
    • ba is the percentage for the blue component (-100 to 100).
    • bb is the offset for the blue component (-255 to 255).
    • aa is the percentage for alpha (-100 to 100).
    • ab is the offset for alpha (-255 to 255).

    You create a colorTransformObject parameter as follows:

    myColorTransform = new Object();
    myColorTransform.ra = 50;
    myColorTransform.rb = 244;
    myColorTransform.ga = 40;
    myColorTransform.gb = 112;
    myColorTransform.ba = 12;
    myColorTransform.bb = 90;
    myColorTransform.aa = 40;
    myColorTransform.ab = 70;

    You can also use the following syntax to create a colorTransformObject parameter:

    myColorTransform = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb: '90', aa: '40', ab: '70'}

  7. #7
    ho provato anche a settare alpha non mi trova la clip bg!!Non capisco perchè!!

  8. #8
    la clip "bg" dove si trova rispetto al movieclip con questo codice?

  9. #9
    la clip bg si trova in un altro swf che io carico nel primo fotogramma in una clip che si chiama bgclip, ho provato anche così:
    _root.mybg = new Color(_root.bgclip.bg);

  10. #10
    se fai un trace(_root.bgclip.bg) che cosa ti da?
    p.s. a cosa ti serve l'evento onData ?

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.