Comunidad de diseño web y desarrollo en internet online

URLRequest sin http:

Citar            
MensajeEscrito el 31 Ene 2012 12:10 pm
Hola.

Quiero que mi aplicación abra una url en el navegador. Utilizando este código todo funciona ok.

Código ActionScript :

navigateToURL(new URLRequest("http://www.dominio.com/"), "_blank");


Pero si quito http: de la url el navegador se me abre pero no muestra la página deseada.

Código ActionScript :

navigateToURL(new URLRequest("//www.dominio.com/multijugador/chinchon/"), "_blank");


Existe alguna manera de no tener que escribir "http" en la url y que funcione correctemente. La motivación de esto es que en ocasiones se debe abrir con http y otras veces como https.

Gracias.

Por ElMarkis

55 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 31 Ene 2012 05:05 pm
Puedes usar una ruta relativa (desde la raíz ) asi

navigateToURL(new URLRequest("/multijugador/");

El protocolo lo puedes tomar desde una variable

Código ActionScript :

var uri:String = "http://";
navigateToURL(new URLRequest(uri+"/multijugador/");


Si puedes saber por alguna condición adonde irás la variable será útil
Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 20 Feb 2012 09:39 am
Gracias Jorge.

Por ElMarkis

55 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 24 Feb 2012 02:26 pm
HOLA BUENOS DIAS!!! SOY NOVATO EN AS3. ME FASCINA FLASH Y POR LO TANTO ME EH PUESTO A PROGRAMAR UN REPRODUCTOR MP3 BASICO, YA DEFINI LAS VARIABLES PERO AL MOMENTO DE DEPURAR ERRORES ME ARROJA "No se pudo cargar la clase o interfaz 'URLRequest'." Y "No se pudo cargar la clase o interfaz 'SoundChannel'.". LES PASO LA SINTAXIS COMPLETA PARA VER SI ALGUIEN ME AYUDA:
// 1.-Asignar Variables y Cargar Sonidos

var archivoMp3:URLRequest = new URLRequest("mp3basico/fantastique.mp3");
var sonido:Sound = new Sound();
var controlAudio:SoundChannel = new SoundChannel();
var tiempoMp3:Number = 0;

sonido.load(archivoMp3);

play_pausa_btn.buttonMode = true;

GRACIAS POR TU AYUDA... MARCOS :D

Por P-LU-K2005

3 de clabLevel



 

msie8
Citar            
MensajeEscrito el 24 Feb 2012 02:34 pm
Agrega

import flash.net.URLRequest
import flash.media.SoundChannel

En general cuando te de ese tipo de error es que te falta el import

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Feb 2012 02:58 pm
Jorge disculpa las molestias, pero me podrias indicar donde coloco lo que me respondiste porque no me doy cuenta!!

Por P-LU-K2005

3 de clabLevel



 

msie8
Citar            
MensajeEscrito el 24 Feb 2012 03:10 pm
Justo antes del código que pusiste.

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Feb 2012 03:33 pm
Entonces lo estoy colocando bien pero me sigue arrojando el error de sintaxis!!

// 1.-Asignar Variables y Cargar Sonidos

import flash.net.URLRequest;

var archivoMp3:URLRequest = new URLRequest("mp3basico/fantastique.mp3");
var sonido:Sound = new Sound();
var controlAudio:SoundChannel = new SoundChannel();
var tiempoMp3:Number = 0;

sonido.load(archivoMp3);

play_pausa_btn.buttonMode = true;

GRACIAS POR TU AYUDA... MARCOS

Por P-LU-K2005

3 de clabLevel



 

msie8
Citar            
MensajeEscrito el 24 Feb 2012 03:47 pm
Te puse dos imports y veo que haz puesto uno solo. Siempre que te de error, pon el texto del error, sino no es undato informativo

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Feb 2012 09:56 pm
jorge disculpa las molestias pero ya hice toda la sintaxis tal cual me indicaste pero sigue arrojando los mismos errores. te la paso:

// 1.-Asignar Variables y Cargar Sonidos

import flash.net.Event;
import flash.net.URLRequest;
import flash.net.SoundChannel;
var archivoMp3:URLRequest = new URLRequest("mp3basico\fantastique.mp3");
var sonido:Sound = new Sound();
var controlAudio:SoundChannel = new SoundChannel();
var tiempoMp3:Number = 0;


sonido.load(archivoMp3);

play_pausa_btn.buttonMode = true;

//2.- Crear los listeners de los botones principales de audio.

sonido.addEventListener(Event.COMPLETE, mp3Lodeado);

function mp3Lodeado(event:Event):void
{
play_pausa_btn.addEventListener(MouseEvent.CLICK, repoducirSonido);
stop_btn.addEventListener(MouseEvent.CLICK, pararSonido);
}


No se pudo cargar la clase o interfaz 'flash.net.URLRequest'. en var archivoMp3:URLRequest = new URLRequest("mp3basico\fantastique.mp3");
No se pudo cargar la clase o interfaz 'flash.net.SoundChannel'. en var controlAudio:SoundChannel = new SoundChannel();
No se pudo cargar la clase o interfaz 'flash.net.Event'. en function mp3Lodeado(event:Event):void

Por P-LU-K2005

3 de clabLevel



 

msie8
Citar            
MensajeEscrito el 25 Feb 2012 12:15 am
¿Estás publicando para AS3? Verifica en menú Archivo, Opciones de Publicación, Tab Flash

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 25 Feb 2012 01:48 pm
En la ruta que me marcas me indica para publicar ActionScrip2.0 y 1.0 y Flash 9

Por P-LU-K2005

3 de clabLevel



 

msie8
Citar            
MensajeEscrito el 26 Feb 2012 11:58 am
Selecciona AS3, sino siempre te va a dar error

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

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