Copy link to clipboard
Copied
Hi. I am following this tutorial
and trying to get the event handler:
AnEvent.MOUSE_DOWN
to work, but it won't work. I'm trying to get it to trigger an alert to test it.
I was able to get
AnEvent.MOUSE_OVER
to successfully trigger an alert.
Here is my code:
this.movieClip_2.addEventListener(AnEvent.MOUSE_OVER, mouseover);
function mouseover()
{
alert("Moused over");
}
this.backg.addEventListener(AnEvent.MOUSE_DOWN, mousedown);
function mousedown()
{
alert("Moused down");
}
Any help?
Copy link to clipboard
Copied
You know, this is really expensive software for not offering any customer support... I could be using Unity which blows Animate out of the water and is free, not to mention any of the other free programs that have more robust customer support...when they're free...
Copy link to clipboard
Copied
Hi.
Sorry for the delay in answering.
I usded the code below and everything worked as expected.
{
var _this = this;
_this.movieClip_2.addEventListener(AnEvent.MOUSE_OVER, function()
{
alert("Moused over");
});
_this.backg.addEventListener(AnEvent.MOUSE_DOWN, function()
{
alert("Moused down");
});
}
Can you provide more details?
Regards,
JC
Copy link to clipboard
Copied
Thanks. (Also you don't owe me a speedy response but thank you!) I'll do some testing and report back.
Copy link to clipboard
Copied
Tested this and
_this.backg.addEventListener(AnEvent.MOUSE_DOWN, function()
{
alert("Moused down");
});
still does not work... any thoughts? You're sure it's working for you? The backg is a background panorama for which I've clicked 'create texture wrapping for all layers', could that be causing the problem? Can I not use actions on panorama background layers?
Copy link to clipboard
Copied
Hi.
Sorry for the delay.
It seems that instances that belong to texture layers can't be referenced by their name.
Don't you get a reference error in the browser console when you try to add the event listener? Like this:
The workaround I can suggest to you is to add the events to instances that belong to regular layers.
I wish I could be of more help but the WebGL documents are still in beta and they don't have an official documentation yet.
Regards,
JC
Copy link to clipboard
Copied
Looking at the same tutorial; I've a 360 panorama on frame 1 of main timeline, button object on same (2 frames). I want to go to frame 2 main timeline on click (another panorama) - because apparently scenes do not work in VR 360 except for under one circumstance, which is where you have tested the scene and in the process created an html page for that scene (which is a trap to avoid, because then you're actually linking to another page, not a scene, and has associated loading time). I now have this on frame 1:
this.stop();
// add mouse handles for the directional 'direction_sign_1' movie clip
this.direction_sign_1.addEventListener(AnEvent.MOUSE_OVER, function() {
this.play();
});
this.direction_sign_1.addEventListener(AnEvent.MOUSE_OUT, function() {
this.gotoAndStop(1);
});
this.direction_sign_1.addEventListener(AnEvent.CLICK, function() {
anWebgl.root.gotoAndPlay(2);
});
This works when tested and also works locally in Firefox with local content enabled. I'm now struggling to make it work on an AWS S3 bucket for online testing - any suggestions on that very much appreciated.