1 Reply Latest reply on Jun 26, 2009 10:25 AM by kglad

    how  center the images whith the frame?

    Gerson.Novais

      Hi,

      I need help, my friend created an flash, it is an advertising movie and the images get from the XML file.

      In flash have an white frame and put the image in frame, one frame one image...

      If have 3 images, have too 3 frames

      however the frame is greater than the image, the image have 100px vs 90px maximums.

      but if the image no have this px, for exemple, 100x80, 10px of the bottom frame was showing. The images not is centred whith the frame.

      I not understand flash and my friend can't help me now.

      how  center the images whith the frame?

       

      stop();

      // Preparando variáveis
      ITEMS    = new Array();
      ITEMS_LINK   = new Array();
      ITEMS_ID   = new Array();
      arrTEMP    = new Array();
      arrlTEMP   = new Array();
      BASE_URL   = null;
      ITEMS_BUFFERED  = 10;
      LOADED    = ITEMS_BUFFERED;
      REPLICATOR_LOADED = false;
      MOUSE_OVER   = false;

      ACELERACAO   = 1;

      // Definindo o XML que será usado
      XML_file   = (_level0.myXML == undefined) ? 'default.xml' : _level0.myXML;

      MSG = XML_file;

      // Iniciando objeto XML
      var myXML:XML  = new XML;
      myXML.ignoreWhite = true;

      // Preparando para ler o XML
      myXML.onData = function ( src:String ) {
      if( src != undefined )
      this.parseXML( src );

      // Percorrendo os dados
      for( childNode in this.childNodes )
      parseMyXML( this.childNodes[childNode] );

      _root.play();
      }

      // Carregando o XML
      myXML.load( XML_file );

      // Função que gerencia os dados carregados
      function parseMyXML( dados )
      {
      for( child in dados.childNodes )
      {
        if( dados.childNodes[child].nodeName =='item' )
        {
         ITEMS.push( dados.childNodes[child].firstChild.nodeValue );
         ITEMS_LINK.push( dados.childNodes[child].attributes.variavel );
        } else if( dados.childNodes[child].nodeName =='baselink' ) {
         BASE_URL = dados.childNodes[child].firstChild.nodeValue;
        } else {
         parseMyXML( dados.childNodes[child].toString() );
        }
      }
      }

      function myReplicator()
      {
      _root.REPLICATOR_LOADED = true;

      // Escondendo CopyCat
      CopyCat._visible = false;

      for( i =Math.max(ITEMS_BUFFERED, ITEMS.length); i >=0; i-- )
      {
        // Prepara variável para carregar items
        if( arrTEMP.length <1 )
        {
         arrTEMP  = arrTEMP.concat(ITEMS);
         arrlTEMP = arrlTEMP.concat(ITEMS_LINK);
        }
       
        // Declara as variáveis para os MovieClips
        DEPTH  = _root.getNextHighestDepth();
        POS_X  = ( POS_X ==undefined ) ? 5 : POS_X +105;
        POS_Y  = 5;
       
        // Duplica os MovieClips
        tCC   = CopyCat.duplicateMovieClip('CopyCat' +i, DEPTH, {_x: POS_X, _y: POS_Y, _visible: false});
        ITEMS_ID.push('CopyCat' +i);
       
        it   = arrTEMP.shift();
        lk   = arrlTEMP.shift();
       
        // Carrega os items
        if( it != undefined )
        {
         tCC.abrir = it;
         tCC.endereco = BASE_URL +lk;
         tCC.play();
        }
      }
      }