Ir para conteúdo
Fórum Script Brasil
  • 0

Servidor localhost


IAMDIX

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0
Se o swf carregar components ou variaveis de contexto será necessário rodar apartir de um servidor web, as versões prof. do windows tem o IIS para colocar numa pasta dentro do InetPub e acessa via http.

nesse tempo testei o wamp aqui mas parece que as funções relativas ao swfaddress não estão funcionando

Vou ver se tenho o iss no window xp-pro

Link para o comentário
Compartilhar em outros sites

  • 0

então testei tambem no iss e não funciona

aqui os codigos ....de repente fiz algo errado

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
                <title>TITULO DO SITE</title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                &lt;script type="text/javascript" src="swfobject.js"></script>
                &lt;script type="text/javascript" src="swfaddress.js"></script>
                &lt;script type="text/javascript" src="swffit.js" /></script>
                &lt;script type="text/javascript">
                        <!-- Adobe recommends that developers use SWFObject2 for Flash Player detection. -->
                        <!-- For more information see the SWFObject page at Google code (http://code.google.com/p/swfobject/). -->
                        <!-- Information is also available on the Adobe Developer Connection Under Detecting Flash Player versions and embedding SWF files with SWFObject 2" -->
                        <!-- Set to minimum required Flash Player version or 0 for no version detection -->
                        var swfVersionStr = "10.0.2";
                        <!-- xiSwfUrlStr can be used to define an express installer SWF. -->
                        var xiSwfUrlStr = "";
                        var flashvars = {};
                        var params = {};
                        params.quality = "best";
                        params.bgcolor = "#000000";
                        params.play = "true";
                        params.loop = "true";
                        params.wmode = "window";
                        params.scale = "showall";
                        params.menu = "true";
                        params.devicefont = "false";
                        params.salign = "";
                        params.allowscriptaccess = "sameDomain";
                        params.allowFullScreen = "true";
                        var attributes = {};
                        attributes.id = "TITULO DO SITE";
                        attributes.name = "TITULO DO SITE";
                        attributes.align = "middle";
                        swfobject.createCSS("html", "height:100%; background-color: #000000;");
                        swfobject.createCSS("body", "margin:0; padding:0; overflow:hidden; height:100%;");
                        swfobject.embedSWF(
                                "SITE.swf", "SITE",
                                "100%", "100%",
                                swfVersionStr, xiSwfUrlStr,
                                flashvars, params, attributes, "expressInstall.swf" );
                                swffit.fit("SITE.swf", 950, 600);//950 represents the minimum width and 
                //600 represents the minimum height 
                //which are the boundaries for triggering scrollbars - Use your own appropriate values.
                </script>
        </head>
        <body>
                <!-- SWFObject's dynamic embed method replaces this alternative HTML content for Flash content when enough JavaScript and Flash plug-in support is available. -->
                <div id="TITULO DO SITE">
                <h1>EXPLICAÇÃO DO SITE</h1>
                        <h2>centro</h2>
                        <p>O <strong>TITULO DO SITE</strong> OUTRA EXPLICAÇÃO DO SITE <strong>ALGO MUITO RELEVANTE RELATIVO AO SITE</strong>
OUTRA EXPLICAÇÃO DO SITE.<p>
                        <a href="http://www.adobe.com/go/getflash">
                                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                        </a>
                        <p>This page requires Flash Player version 10.0.2 or higher.</p>
                </div>
        </body>
</html>
AS3
//stop();
import app.*;
import navigation.*;
import swffit.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.display.StageAlign;

//*******CODIGO SWFAddress*********//
import com.asual.*;
SWFAddress.addEventListener(SWFAddressEvent.CHANGE, changeURL);
function changeURL(e:SWFAddressEvent):void
{
        if (e.value != "/")
        {
                SWFAddress.setTitle("TITULO DO SITE - " + e.value.substring(1));
        }
        else
        {
                SWFAddress.setTitle("TITULO DO SITE - NOME DA HOMEPAGE");

        }
        switch (e.value)
        {
                case "/home" :
                        abre_home(null);
                        break;

                case "/About" :
                        abre_About(null);
                        break;

                case "/Contato" :
                        abre_Contato(null);
                        break;

                case "/GoogleMap" :
                        abre_GoogleMap(null);
                        break;

                case "/" :
                        abre_home(null);
                        break;
        }
}
var carregarswf:Loader = new Loader();//utiliza o mesmo carregador pra todos os swf
container_mc.addChild(carregarswf);

//abre_home(null);//carrega primeiro a home.swf

/*********************
 * EVENTS
 *********************/
//carregarswf.addEventListener(MouseEvent.CLICK, someImagem);
b1_btn.addEventListener(MouseEvent.CLICK, abre_home);
b2_btn.addEventListener(MouseEvent.CLICK, abre_About);
b3_btn.addEventListener(MouseEvent.CLICK, abre_Contato);
b4_btn.addEventListener(MouseEvent.CLICK, abre_GoogleMap);

*/*********************
 * FUNCTIONS
 *********************/
/*
function someImagem(meuEvento:MouseEvent):void {
carregarswf.unload();//descarrega conteudo do loader
}*/
function abre_home(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("home.swf"));
        SWFAddress.setValue("home");
}
function abre_About(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("About.swf"));
        SWFAddress.setValue("About");
}
function abre_Contato(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("Contato.swf"));
        SWFAddress.setValue("Contato");
}
function abre_GoogleMap(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("GoogleMap.swf"));
        SWFAddress.setValue("GoogleMap");
}

Link para o comentário
Compartilhar em outros sites

  • 0

Consegui resolver e aqui vai a solução para historico

Tem que entender como o SWFAddress funciona:

1. The usuario clica no botão

2. SWFAddress.setValue("home") para dizer ao navegador a palavra que queremos usar

3. SWFAddress.CHANGE event

4. Ação dependendo do value

//stop();
import app.*;
import navigation.*;
import swffit.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.Stage;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import com.asual.*;

var carregarswf:Loader = new Loader();//utiliza o mesmo carregador pra todos os swf
container_mc.addChild(carregarswf);

abre_home(null);//carrega primeiro a home.swf

/*********************
 * EVENTS
 *********************/
//carregarswf.addEventListener(MouseEvent.CLICK, someImagem);
b1_btn.addEventListener(MouseEvent.CLICK, abre_home);
b2_btn.addEventListener(MouseEvent.CLICK, abre_About);
b3_btn.addEventListener(MouseEvent.CLICK, abre_Contato);
b4_btn.addEventListener(MouseEvent.CLICK, abre_GoogleMap);

*/*********************
 * FUNCTIONS
 *********************/
/*
function someImagem(meuEvento:MouseEvent):void {
carregarswf.unload();//descarrega conteudo do loader
}*/
function abre_home(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("home.swf"));
        SWFAddress.setValue("home");
}
function abre_About(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("About.swf"));
        SWFAddress.setValue("About");
}
function abre_Contato(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("Contato.swf"));
        SWFAddress.setValue("Contato");
}
function abre_GoogleMap(e:MouseEvent):void
{
        carregarswf.load(new URLRequest("GoogleMap.swf"));
        SWFAddress.setValue("GoogleMap");
}

//*******SWFAddress*********//

SWFAddress.addEventListener(SWFAddressEvent.CHANGE, changeURL);
function changeURL(e:SWFAddressEvent):void
{
        if (e.value != "/")
        {
                SWFAddress.setTitle("TITULO DO SITE - " + e.value.substring(1));
        }
        else
        {
                SWFAddress.setTitle("TITULO DO SITE - NOME DA HOMEPAGE");

        }
        switch (e.value)
        {
                case "/home" :
                        abre_home(null);
                        break;

                case "/About" :
                        abre_About(null);
                        break;

                case "/Contato" :
                        abre_Contato(null);
                        break;

                case "/GoogleMap" :
                        abre_GoogleMap(null);
                        break;

                case "/" :
                        abre_home(null);
                        break;
        }
}

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,5k
×
×
  • Criar Novo...