Comunidad de diseño web y desarrollo en internet online

porfa quien me ayuda con esto, Stage.width / Stage.Height

Citar            
MensajeEscrito el 14 Sep 2007 03:26 pm
porfa alguien podria explicarme como hacer en estos casos?? cuando en un codigo me dan la opcion para modificarlo, hay me dicen que puedo modificar las dimensiones del player, pero nose como colocar esos valores, y donde. en el tercer parrafo esta la opcion, pero en vista en el Flash ese texto sale en gris, porfa que alguien me ayude, como y donde coloco esa propiedad


Código :

//--------------------------------------------------------------------------
// initial variables that might be useful to change
//--------------------------------------------------------------------------

// toggle for which file to play if none was set in html
// you can change the 'test.flv' in your filename
!_root.file ? file = "cap1.flv" : file = _root.file;

// toggle for autostarting the video
// you can change the 'true' in 'false'
!_root.autoStart ? autoStart = true: autoStart = _root.autoStart;

// toggle for the width and height of the video
// you can change them to the width and height you want
w = Stage.width;
h = Stage.height;

//--------------------------------------------------------------------------
// stream setup and functions
//--------------------------------------------------------------------------

// create and set netstream
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.setBufferTime(5);

// create and set sound object
this.createEmptyMovieClip("snd", 0);
snd.attachAudio(ns);
audio = new Sound(snd);
unmuteBut._visible = false;

//attach videodisplay
videoDisplay.attachVideo(ns);

// Retrieve duration meta data from netstream
ns.onMetaData = function(obj) {
   this.totalTime = obj.duration;
   // these two lines were used for automatically sizing
   // it is now done by sizing the video to stage dimensions
   // w = videoDisplay.width;
   // h = videoDisplay.height;
};

// retrieve status messages from netstream
ns.onStatus = function(object) { 
   if (object.code == "NetStream.Play.Start") {
      // this is invoked when the stream starts playing
      // w = videoDisplay.width;
      // h = videoDisplay.height;
   } else if(object.code == "NetStream.Buffer.Full") {
      // this is invoked when the stream is buffered
      // w = videoDisplay.width;
      // h = videoDisplay.height;
   } else if(object.code == "NetStream.Play.Stop") {
      // rewind and pause on when movie is finished
      ns.seek(0);
      ns.pause();
      playBut._visible = true;
      pauseBut._visible = false;
      videoDisplay._visible = false;
      playText.txt.text = "click to play";
   }
};


//--------------------------------------------------------------------------
// controlbar functionality
//--------------------------------------------------------------------------

// play the movie and hide playbutton
function playMovie() {
   if(!isStarted) {
      ns.play(file);
      playText.txt.text = "loading ..";
      isStarted = true;
   } else {
      ns.pause();
   }
   pauseBut._visible = true;
   playBut._visible = false;
   videoDisplay._visible = true;
}

// pause the movie and hide pausebutton
function pauseMovie() {
   ns.pause();
   playBut._visible = true;
   pauseBut._visible = false;
};

// video click action
videoBg.onPress = function() {
   if(pauseBut._visible == false) {
      playMovie();
   } else {
      pauseMovie();
   }
};

// pause button action
pauseBut.onPress = function() {
   pauseMovie();
};

// play button action
playBut.onPress = function() {
   playMovie();
};

// file load progress
percentBar.onEnterFrame = function() {
   loaded = this._parent.ns.bytesLoaded;
   total = this._parent.ns.bytesTotal;
   if (loaded == total && loaded>1000) {
      percentBar._width = bw;
      delete this.onEnterFrame;
   } else {
      percentBar._width = int(bw*loaded/total);
   }
};

// play progress function
progressBar.onEnterFrame = function() {
   this._width = bw*ns.time/ns.totalTime;
};

// start playhead scrubbing
centerBg.onPress = function() {
   this.onEnterFrame = function() {
      scl = this._xmouse*this._xscale/bw/100;
      ns.seek(scl*ns.totalTime);
   };
};

// stop playhead scrubbing
centerBg.onRelease = centerBg.onReleaseOutside = function () { 
   delete this.onEnterFrame;
   pauseBut._visible == false ? videoDisplay.pause() : null;
};

// mute button action
muteBut.onPress = function() {
   audio.setVolume(0);
   unmuteBut._visible = true;
   this._visible = false;
};

// unmute button action
unmuteBut.onPress = function() {
   audio.setVolume(100);
   muteBut._visible = true;
   this._visible = false;
};

//--------------------------------------------------------------------------
// resize and position all items
//--------------------------------------------------------------------------

// set videodisplay dimensions
videoDisplay._width = videoBg._width = w;
videoDisplay._height = videoBg._height = h-20;
playText._x = w/2;
playText._y = h/2-10;

// resize the items on the left .. 
leftBg._x = 0;
leftBg._y = h-20;
playBut._x = pauseBut._x = 12;
playBut._y = pauseBut._y = h-10;

// resize the items in the middle .. 
centerBg._x = percentBar._x = progressBar._x = backBar._x = 21;
centerBg._y = h - 20;
percentBar._y = progressBar._y = h - 12;
bw = centerBg._width = percentBar._width = progressBar._width = w - 42;

// and resize the ones on the right ..
rightBg._x = w - 21;
rightBg._y = h - 20; 
muteBut._x = unmuteBut._x =  w - 11;
muteBut._y = unmuteBut._y = h - 10;


//--------------------------------------------------------------------------
// all done ? start the movie !
//--------------------------------------------------------------------------

// start playing the movie
// if no autoStart it searches for a placeholder jpg
// and hides the pauseBut
if (autoStart == true) {
   playMovie();
} else {
   pauseBut._visible = false;
   imageStr = substring(file,0,file.length-3)+"jpg";
   imageClip.loadMovie(imageStr);
}

Por guarock

100 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Sep 2007 01:12 am
Te digo algo... Me da una reverenda lata leer todo tu codigo :lol:

Por JaLeRu

Claber

1913 de clabLevel

7 tutoriales

Genero:Masculino  

Existo

firefox
Citar            
MensajeEscrito el 16 Sep 2007 01:44 am
...Yo tampoco leí todo tu código...
De todas maneras, las propiedades Stage.width y Stage.height son de sólo lectura, o sea que no puedes cambiar el tamaño de player por código (a menos que uses un software de terceros). Lo que sí puedes hacer con esas propiedades es conocer el valor del ancho y el alto del escenario.

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox
Citar            
MensajeEscrito el 16 Sep 2007 07:01 am
Sip, fijate como tienes

// initial variables that might be useful to change
// toggle for the width and height of the video
// you can change them to the width and height you want
w = Stage.width;
h = Stage.height;

Le esta dando los valores del escenario a "w" y "h".
Si no estaria al reves,
Stage.width=w;
Stage.height=h;
que es como tu quieres... pero como dice The Fricky!, no se puede.

P.D. Hubieras puesto solo lo primero XD (mucho codigo).

Por Wako

77 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Sep 2007 09:07 am
Buenas, como te han comentado solo puedes cambiar el tamaño del escenario mediante programas tipo adobe AIR, mProjector etc. Sin embargo si lo que quieres es un swf que pueda embeber en una pagina html en cualquier tamaño, lo que tienes que hacer es indicarle el tamaño que debe tener el flash desde el codigo html a la hora de incrustarlo, dentro del swf tendrás que reposicionar y reescalar a mano todos los elementos según quieras que permanezcan estáticos, que crezcan en un eje o en ambos.

Si queréis ejemplos de código decidmelo que lo busco :wink:

Por darkwin

1 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 16 Sep 2007 01:45 pm
muchas gracias a todos,

uhm bueno si tienen razon, coloque mucho codigo, pero bueno nose, pense que era necesario, pero jeje tienen razon da lata leer todo eso

y con respecto a lo otro, muchas gracias, pense que si se podia fijar las dimenciones del player al cual pertenece ese codigo. De todas maneras muchas gracias por sus respuestas.. almenos ya se que no se puede, :)

Por guarock

100 de clabLevel



 

firefox
Citar            
MensajeEscrito el 18 Sep 2007 11:59 am
probaste con lo siguiente?

stage.stageWidth = width
stage.stageHeight height

saludos

Por eka

2 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 18 Sep 2007 02:09 pm

eka escribió:

probaste con lo siguiente?

stage.stageWidth = width
stage.stageHeight height

saludos


Estas propiedades sin son de lectura/escritura, pero son de AS3, no de AS2.

Por The Fricky!

Presidente

6168 de clabLevel

3 tutoriales
8 articulos

Genero:Masculino   Bastard Operators From Hell Héroes

Piccola Venezia...

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.