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

ErMsg[findIndexF(i)]._alpha= 100;

Participant ,
Sep 27, 2013 Sep 27, 2013

I want to be able to make the relevent ErMsg to alpha 100 if infoDats0 or infoDats1 text length is <=1. Below is my code and can't get it to work?

var chkEk:Array = [chkE0, chkE1]

var theTFa = new Array(infoDats0, infoDats1)

var ErMsg = new Array(Field0, Field1) // alpha is set to 0 at the start

function findIndexF(tf:TextField):Number{

          for(var i:Number=0;i<theTFa.length;i++){

                    if(tf==theTFa){

                              return i;

                    }

          }

};

goUp_btn.onRelease = function() {

var chkE0 = infoDats0.text.split(' ').join('');

var chkE1 = infoDats1.text.split(' ').join('');

          for(i=0; i<theTFa.length; i++){

                    if (chkE0.length>1 && chkE1.length>1){

                              //doSome

                    } else {

                              if (chkEk.length<=1){

                                        ErMsg[findIndexF(i)]._alpha= 100; //not working

                              }

                    }

          }

};

TOPICS
ActionScript
1.5K
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

Community Expert , Sep 28, 2013 Sep 28, 2013

click your button and opy and paste the trace output using

goUp_btn.onRelease = function() {

var chkE0 = infoDats0.text.split(' ').join('');

var chkE1 = infoDats1.text.split(' ').join('');

trace(chkE0+" : "+chkE1);

trace(chkEk);

          for(i=0; i<theTFa.length; i++){

                    if (chkE0.length>1 && chkE1.length>1){

                              //doSome

                    } else {

                              if (chkEk.length<=1){

                                        ErMsg[findIndexF(i)].

...
Translate
Community Expert ,
Sep 27, 2013 Sep 27, 2013

findIndexF is expecting a textfield and you're passing a number.  that's not going to work.

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
Participant ,
Sep 27, 2013 Sep 27, 2013

How should I approach in getting this fixed? is there a way to relate theTFa to chkEk ?

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
Community Expert ,
Sep 27, 2013 Sep 27, 2013

findIndexF(ErMsg) makes more sense but in the context of your code it looks like you might want to use:

ErMsg._alpha=100;

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
Participant ,
Sep 27, 2013 Sep 27, 2013

Thanks kglad. I tried both;

findIndexF(ErMsg)  - did not work'.

ErMsg - turned everything (ErMsg) to 100 alpha.

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
Community Expert ,
Sep 27, 2013 Sep 27, 2013

what do chkE0 and chkE1 look like?

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
Participant ,
Sep 27, 2013 Sep 27, 2013

variables. I'm using those variables to make sure there's some text in theTFa at the time its being pressed.

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
Community Expert ,
Sep 27, 2013 Sep 27, 2013

i know they're variables.  what are their values?

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
Participant ,
Sep 28, 2013 Sep 28, 2013

infoDats0 text field contains the users name and infoDats1 contains postcode. I'm basically trying to avoid those 2 text fields being empty when goUP_btn is pressed.

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
Community Expert ,
Sep 28, 2013 Sep 28, 2013

click your button and opy and paste the trace output using

goUp_btn.onRelease = function() {

var chkE0 = infoDats0.text.split(' ').join('');

var chkE1 = infoDats1.text.split(' ').join('');

trace(chkE0+" : "+chkE1);

trace(chkEk);

          for(i=0; i<theTFa.length; i++){

                    if (chkE0.length>1 && chkE1.length>1){

                              //doSome

                    } else {

                              if (chkEk.length<=1){

                                        ErMsg[findIndexF(i)]._alpha= 100; //not working

                              }

                    }

          }

};

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
Participant ,
Sep 28, 2013 Sep 28, 2013

thank YOU kglad.

chkEk was undefined. Got it fixed!

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
Community Expert ,
Sep 28, 2013 Sep 28, 2013
LATEST

you're welcome.

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