Many of you might have created a flash file to embed it in your website. It all seems really easy, but once you try to embed, you discover that you cant click on it. It just wouldn’t redirect you to a specific website. Now you might wonder, it would as simple as using a anchor tag followed with the href attribute, but you are wrong.
After some research I found that all you have to do is create an additional layer with the link assigned to it. This can be archived using Adobe Flash.
Following these steps and you should be able to create your very own click-able flash file. If you find it difficult to understand there is a video tutorial at the end of this post.
- Execute Adobe Flash.
- Choose Action Script 3.0.
- Set the desired height and width.
- Select the first key frame from Layer 1 and click on File -> Import -> Import to stage.
- Select your flash file.
- Now you should see your flash document loaded.
- Create a new layer & select the first key frame of the new layer.
- Click on Insert and then select New Symbol and choose the type button.
- Add two frames in your symbol.
- Select the rectangle tool and draw a rectangle bigger than your actual project.
- Click on scene 1
- Drag the button from the library to your flash file
- Extend the key frame of layer to till the end of the flash file
- Go to Windows and the Actions and paste the following
var link:URLRequest = new URLRequest ("http://www.google.com/");
btn_1.addEventListener(MouseEvent.CLICK, gooo);
function gooo(event:MouseEvent):void {
navigateToURL(link);
}
- And finally, change the instance name to btn_1
Administrador de ENGGDRCAOS. Canal dedicado especialmente a la formación del estudiante que aspira a ser ingeniero. Todos los videos son Ingles. Apasionado del universo Apple, estudiante de Ingeniería y Gamer por vocación.