1
votes

I have a multiple scenes *.fla, there is a linkage between scenes using buttons which works just fine.

Some of these scenes contain components ScrollPane (1 per scene), inside a ScrollPanes there area movie clips holding buttons - which also work fine linking to other scenes.

I have now put new button within movie clip (within ScrollPane) "go to web" ... which doesn't work... no errors are reported when compiling to swf, button is there but doesn't do anything.

I was using simple code from code snippet:

my_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.site.com/"), "_blank");
}

I searched for solutions and tried following:

put movieclip name in front of button: myMovieClip.my_btn.addEventListener ... (not working) put mc + scrollPane name: myMovieClip.myScrollPane.my_btn.addEventListener ... (not working) put Scene name: myScene.my_btn.addEventListener ..... (not working)

.. and more diferent combinatios of above, none works.. some of them produce errors, some not.. if swf goes through, button is visible but doesn't do anything...

What's more I tried to put new buttons within other movie clips that I already have working buttons in them, and the new buttons not working.....the one I put earlier working just fine.. ??

I don't know what to think? Have I run out of button limits, is there a limit of how many buttons you can have in 1 *.fla? (I have about 130 I would think, on about 60 scenes, each scene has just one frame, and two layers - one for content one for actions)

my code for buttons is in movie clip where they are.

If any one could give a clue please?

1

1 Answers

0
votes

Looks to me that your code is fine. The problem is probably inside Flash's security sandbox measures.

If you're testing your application on your own computer, you'll need to enable access to the folder the swf is playing at, or compile it to access network only (by default swfs are compiled to access local files only). More info here: http://www.adobe.com/devnet/flash/articles/local_network_playback.html

If you're testing it in a webserver, you're gonna have to add a entry on the crossdomain.xml allowing access to the following site.