Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
When 2D Overlay clicked, Javascript & Change Texture actions fail

jquindlen
Registered User
Quote
2010-01-16 02:24:45

I'm trying to make 2 actions happen when a user clicks on a 2d overlay

1) Action1: Change a texture
2) Action2: Call a javascript function

Now, when I just use the change texture action, it works fine. But if I add the 2nd action (the javascript call) it makes it so that the texture doesn't change... unless I click the overlay a ton of times really fast, then sometimes it will change the texture as well.

It seems like the javascript action is interfering with the change texture action.

I have tried this in two different ways:
1) 2 separate "on clicked" actions for the overlay
2) 1 "on clicked" action, with both actions set in the same "click" action

Thanks for the new update by the way Niko. And always, thanks for your hard work. ;)


niko
Moderator
Quote
2010-01-17 09:43:08

Hi,
I guess you are running your .swf locally or from a webserver on the localhost?
The problem here seems to be that Flash is throwing a security error while trying to call the JavaScript when the swf is run locally, causing CopperCube to temporary stop running in this frame. I'll add a change in the next version so that Coppercube will still run then, but this won't change the problem that the javascript will not be executed at all.

To make this work, you simply need to run your .swf from a webserver. Or grant all rights to the swf on your harddisk using the Security manager from Adobe.

Hope this helps.


jquindlen
Registered User
Quote
2010-02-01 21:45:44

I think you are correct, this is a problem when running locally. Thanks Niko.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact