Copy link to clipboard
Copied
Hi All!
I have a set of symbols which has to be turned off at a specific click...
There for I created on top of the code a global function, like this:
function hideSymbols()
{
console.log("inside hideSymbols");
sym.$("Stage_hoofdVraag1").hide();
console.log("Job done!");
}
There is a symbol called: "hoofdVraag1", I am able to turn it on and off in an event handler but not in a global function.
The function hideSymbols prints the message correct and after that I get the error: Javascript error in event handler! Event Type = element
What am I doing wrong?
Thanks in advance!
Greetings,
Marco
Copy link to clipboard
Copied
use console.log to see if sym and sym.$(etc) are defined.
Copy link to clipboard
Copied
Same error... But that's not strange... If I can't access it from normal code, I also can't access it via console.log/alert functions...
I think I am calling the function on the wrong way... I allready tried many things like:
document.getElementById("Stage_hoofdVraag1").hide();
But nothing worked...
Copy link to clipboard
Copied
you should have been able to pinpoint your error with those two log statements. which is it?
Copy link to clipboard
Copied
No I can't find a solution to my problem...
I can't access images/symbols from a self-defined function...
Still this error: Javascript error in event handler! Event Type = element
Greetings,
Marco
Copy link to clipboard
Copied
look, either sym and sym.$("etc..) are undefined (most likely) or only sym.$("Etc...) is undefined. which is it?
if it's both, you've lost a reference to sym. because you had a reference to it somewhere else in your project, you can continue debugging by tracking what's changed to cause you to lose that reference.
Copy link to clipboard
Copied
Just glancing at your code, my first instinct is that what you're doing wrong is trying to use jQuery to control CreateJS. But there's not enough context given to say that for certain.
Copy link to clipboard
Copied
Okay I will try again to explain...
I have a lot of images one of them is called: "hoofdVraag1"...
Those images has to be turned on and off during runtime...
I want to make a global function which has to do that...
In the evenhandler I use this: sym.$("hoofdVraag1").hide();
That works!
Now I want to do the same in the globalfunction...
Now my question... How to call that function? I can't figure it out...
Do I need to convert that image into a symbol?
Greetings and thanks!
Copy link to clipboard
Copied
Are you using Edge Animate or Animate CC (formerly Flash Pro)?
Copy link to clipboard
Copied
Hello!
I am using Adobe Edge Animate 2015 CC
Still problems and I am not able to find it 😞