Problem with dynamic variable inside movieclips

  • dajnamajt11
  • Born
  • Born
  • dajnamajt11
  • Posts: 1

Post 3+ Months Ago

Hi all,

I recently started learning Flash and Actionscript and now I'm trying to write an actionscript for the first time. Im doing this in Actionscript 2.0.

I have a movieclip that consists of two images and one dynamic text field with a variable. The name of the images are "VS1_P1_RUN" and "VS1_P1_OFF" and the name of the dynamic text field is "pumptext". In the dynamic text field I have the variable "VS1_P1_Ind". VS1_P1_Ind is probably a boolean variable as it shows 1 or 0 in another program but in Flash it shows True or False (not sure if Flash thinks it's a text/word or a boolean).

My script is supposed to display the image named VS1_P1_RUN if the variable of the dynamic text field pumptext shows the text True and it goes like this:

onClipEvent (enterFrame) {
VS1_P1_RUN._visible = false;
VS1_P1_OFF._visible = false;
if (pumptext.text == True) {
VS1_P1_RUN._visible = true;
}
}

This doesn't work.

I have tested the code by changing the text field from dynamic to input and when I type in 5 in the code below everything works;

onClipEvent (enterFrame) {
VS1_P1_RUN._visible = false;
VS1_P1_OFF._visible = false;
if (pumptext.text == 5) {
VS1_P1_RUN._visible = true;
}
}

So I'm completely stuck in what to do. The bottom code works as it should but I want the images to show depending on the value of the variable VS1_P1_Ind. I thought just changing the text field to dynamic and typing the variable name in the variable field would do it but no.

If it could be a clue to the solution I'll also share that the value of the variable is not seen/shown in textfield while inside the movieclip. Creating a dynamic textfield outside of the movieclip shows the value of the variable just fine, True/False.

Any help is greatly appreciated.



Best regards,
/Thomas
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.