Copy link to clipboard
Copied
Hello Again,
I am in a bit of fix here.
I have converted my Flash project to Html Canvas in Flash CC.
But my actions in timeline got commented out and have created a js file.
Its not working as per the actions I have created.
Done a bit of research and have known that the actions would be commented out and js has to be written for the actions wehave given.
As I have no knowledge in programming Java Script, any help in this would be highly appreciated.
This is the script I have been working on...
Thanks in Advance..
import flash.events.MouseEvent;
Wall1.stop();
Wall1.RedCove.visible = false;
Wall1.PearlGrey.visible = false;
Wall1.Boulder.visible = false;
Wall1.Lava.visible = false;
RedCove_btn.visible = false;
PearlGrey_btn.visible = false;
Boulder_btn.visible = false;
Lava_btn.visible = false;
Wall_btn.addEventListener(MouseEvent.CLICK,panels);
function panels(event:MouseEvent):void
{
RedCove_btn.visible = true;
PearlGrey_btn.visible = true;
Boulder_btn.visible = true;
Lava_btn.visible = true;
}
RedCove_btn.addEventListener(MouseEvent.CLICK, redcove);
function redcove(event:MouseEvent):void
{
Wall1.RedCove.visible = true;
Wall1.PearlGrey.visible = false;
Wall1.Boulder.visible = false;
Wall1.Lava.visible = false;
}
PearlGrey_btn.addEventListener(MouseEvent.CLICK, pearlgrey);
function pearlgrey(event:MouseEvent):void
{
Wall1.PearlGrey.visible = true;
Wall1.RedCove.visible = false;
Wall1.Boulder.visible = false;
Wall1.Lava.visible = false;
}
Boulder_btn.addEventListener(MouseEvent.CLICK, boulder);
function boulder(event:MouseEvent):void
{
Wall1.Boulder.visible = true;
Wall1.RedCove.visible = false;
Wall1.Lava.visible = false;
Wall1.PearlGrey.visible = false;
}
Lava_btn.addEventListener(MouseEvent.CLICK, lava);
function lava(event:MouseEvent):void
{
Wall1.Lava.visible = true;
Wall1.RedCove.visible = false;
Wall1.Boulder.visible = false;
Wall1.PearlGrey.visible = false;
}
Original_Image.addEventListener(MouseEvent.CLICK, hide);
function hide (event:MouseEvent):void
{
RedCove_btn.visible = false;
PearlGrey_btn.visible = false;
Boulder_btn.visible = false;
Lava_btn.visible = false;
}
Doing this manually implies code has to be rewritten?
Yes, you have to edit the js file that flash generates after you publish to canvas
EaselJS is a entirely different from AS 3.0 right?
EaselJS is basically a framework which enables you to write JavaScript with classes (similar to actionscript).
A functionality you need to make all the MovieClips/Sprites in your library available to javascript
Check out this tutorial to get a basic understanding:
Copy link to clipboard
Copied
if the autoconversion dosen`t work for your project you will have to do it manually.
The framework you need to look into is documented here:
http://www.createjs.com/Docs/EaselJS/modules/EaselJS.html
click events are handled like this:
Wall_btn.addEventListener("click", panels);
function panels(event){
RedCove_btn.visible = true;
PearlGrey_btn.visible = true;
Boulder_btn.visible = true;
Lava_btn.visible = true;
}
Copy link to clipboard
Copied
Hello moccamaximum,
Doing this manually implies code has to be rewritten?
Or the .js file can be edited??
But the EaselJS is a entirely different from AS 3.0 right??
Please do help me understand.
Thank you.
Copy link to clipboard
Copied
Doing this manually implies code has to be rewritten?
Yes, you have to edit the js file that flash generates after you publish to canvas
EaselJS is a entirely different from AS 3.0 right?
EaselJS is basically a framework which enables you to write JavaScript with classes (similar to actionscript).
A functionality you need to make all the MovieClips/Sprites in your library available to javascript
Check out this tutorial to get a basic understanding: