Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

flash button stops working after 1 click

New Here ,
Jan 17, 2013 Jan 17, 2013

So i have 3 buttons and when i click neither of them ,the clicked one loads the image that i want and them all of them stops working.

import flash.events.MouseEvent;

import flash.net.URLRequest;

imgbtn1.addEventListener(MouseEvent.CLICK, OnReleaseMyButton1);

function OnReleaseMyButton1(event:MouseEvent):void

{

    infoField.visible = true;

    var imageLoader:Loader = new Loader();

    imageLoader.load(new URLRequest("picture1.png"));

    addChild(imageLoader);

    trace("BUtton1");

}

imgbtn2.addEventListener(MouseEvent.CLICK, OnReleaseMyButton2);

function OnReleaseMyButton2(event:MouseEvent):void

{

    infoField.visible = true;

    var imageLoader:Loader = new Loader();

    imageLoader.load(new URLRequest("picture2.png"));

    addChild(imageLoader);

    trace("BUtton2");

}

imgbtn3.addEventListener(MouseEvent.CLICK, OnReleaseMyButton3);

function OnReleaseMyButton3(event:MouseEvent):void

{

    infoField.visible = true;

    var imageLoader:Loader = new Loader();

    imageLoader.load(new URLRequest("picture3.png"));

    addChild(imageLoader);

    trace("BUtton3");

}

//

/*function startLoading(whichImage)

{

    var imageLoader:Loader = new Loader();

    imageLoader.load(new URLRequest("whichImage"));

    addChild(imageLoader);

} */

Here is a link to the .swf file to see what exactly i mean.http://www.fileconvoy.com/dfl.php?id=gf45387fd831a092a999199587cb570046f7c5cf00

TOPICS
ActionScript
607
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jan 17, 2013 Jan 17, 2013

I see you're loading a png - is the png blocking the buttons once you add it? Transparency in the png will block the buttons...

Translate
LEGEND ,
Jan 17, 2013 Jan 17, 2013

I don't see anything happening in the swf you identified except the buttons reacting to mouse inetraction.   When you test in the IDE do you get the traces that you have in each function?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 17, 2013 Jan 17, 2013

I see you're loading a png - is the png blocking the buttons once you add it? Transparency in the png will block the buttons...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 17, 2013 Jan 17, 2013
LATEST

Oh, i didnt know about that, i will test now.I"ll make the png really small and will see if the buttons are working. OK , thanks for the fast help.Transparency was the problem,hiding the buttons and making them inactive(or unable to click on them).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines