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

making a button visible upon trigger of a function

Explorer ,
Jun 10, 2009 Jun 10, 2009

hi,

i created a button that is set to visible= false upon the load of the swf,

and this is button should become visible when it the function is triggered.

but the result to me is that, the button becomes visible and invisible again. you'll just caught a glimpse of the button.

here is my code:

//Instance of the Podcast Button, setting it to invisible
onload()
{
_podcastDownload._visible = false;
}

_podcastDownload.onPress = function()
{
    trace("press occured");
    TriggerPodcast();
}

//Function Podcast Button
function TriggerPodcast():Void
{
    trace("downloadPodcast was clicked");
    _podcastDownload._visible = true;
}

thanks for the help..

TOPICS
ActionScript
547
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
LEGEND ,
Jun 10, 2009 Jun 10, 2009

Can you explain a little more about what is going on in this scenario?  If the button triggers the function, and the button is invisible, you can't click on the button to trigger the function.  Invisible buttons don't 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
Explorer ,
Jun 10, 2009 Jun 10, 2009

what i meant is that at load the button is invisible upon load of the movie. it will only become visible when a certain function is called.

this function is actually triggered by a javascript, when this actionscript function is triggered by a button in java , the button should become visible.

i set the button at visible = true within that function, but, you'll only see a glimpse of the button during the event.

here is the function where the button should be visible. i need the button to stay visible and become invisble only after i closed the player.

but on load i set the button to invisible.

//Instance of the Podcast Button, setting it to invisible
onload()
{
_podcastDownload._visible = true;
}

ExternalInterface.addCallback("sendAudioPodcastURLToFlash",objectInstance,getAudioPodcastURLFromJS);
function getAudioPodcastURLFromJS(AudioPodStr:String,AudioPodStr1:String):Void
    {
        var audPodcastURL:String = AudioPodStr;
        var audPodcastDL:String = AudioPodStr1;
        label_received.text = "The path of the media that was passed to js was: " + audPodcastURL;
        _flvPlayBack.contentPath = audPodcastURL;
        _flvPlayBack.load(audPodcastURL);
        _flvPlayBack.play(audPodcastURL);       
        TriggerPodcast(audPodcastDL);
        _podcastDownload._visible = true;
    }//End of Get Audio Podcast URL from JS 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
LEGEND ,
Jun 11, 2009 Jun 11, 2009
LATEST

What you should do is put identifiable traces at each place where the button is made visible and invisible so that you can identify what is toggling thtat property when.

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