Skip to main content
Participant
March 19, 2013
Question

my swf doesn't work when inserted into my website

  • March 19, 2013
  • 1 reply
  • 544 views

Hi I am trying to create a gallery on my website. The way I am doing it is I am making several swfs that consist of an image that you click on, it goes into full screen, click it again and it goes back, then importing them into dreamweaver. the as3 code I am using in Flash is

import flash.display.StageDisplayState;

function toggleFullScreen():void
{
if (stage.displayState == StageDisplayState.NORMAL) {
  stage.displayState=StageDisplayState.FULL_SCREEN;
} else {
  stage.displayState=StageDisplayState.NORMAL;
}
}

btn_fullsc.buttonMode = true;
btn_fullsc.addEventListener(MouseEvent.CLICK, buttonOnClick)

function buttonOnClick(event:MouseEvent):void
{
toggleFullScreen();
}

When I export and open just the swf, it works, but when imported into dreamweaver, then published it doesn't, it still shows the original image but when you click it nothing happens. What am I doing wrong? any help would be great.

PS

I am an idiot when it comes to computers. If you send me a different code that I'm supposed to use just give me the exact code that I can just copy and paste into flash

This topic has been closed for replies.

1 reply

Inspiring
March 19, 2013

First, change this:

import flash.display.StageDisplayState;

function toggleFullScreen(e:Event):void
{
if (stage.displayState == StageDisplayState.NORMAL) {
  stage.displayState=StageDisplayState.FULL_SCREEN;
} else {
  stage.displayState=StageDisplayState.NORMAL;
}
}

btn_fullsc.buttonMode = true;
btn_fullsc.addEventListener(MouseEvent.CLICK, toggleFullScreen)

Make sure you have the following publishing option in your html-wrapper activated:

(File>Publishing Options>HTML-Wrapper>Template:Flash only - allow Fullscreen)

Participant
March 30, 2013

sorry it's taken so long to reply. I go to insert>media>swf. I haven't tried your code yet but I will and I'll get back to you.