please help me with this tutorial

  • seekthat
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

Hello to this website and the Professional of flash and actionscript...
I am a beginner in Flash and actionscript and found this tutorial located at http://www.learnthat.com/Software/learn ... 4/page/10/
that is not my website and this is not a spam post, keep on reading please...
I did that tutorial and looked over many times, why is mine doesn't work...
when I enter the age then click to go to the next page then the line with words does not appear.
No errors, and everything else works smoothly but no answer on the second frame?

I'm using Flash MX 6.0 2002
is it possible that my actionscript is too old for that tutorial?
please take time to answer and help me...
Thank you in advance...
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

That is action script 2 so it would be fine with your version.

Most likely causes:
Did you make your text box Dynamic?
this you give it an instance name as in the example? (in the example it was "age_txt"
  • seekthat
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

ATNO/TW wrote:
That is action script 2 so it would be fine with your version.

Most likely causes:
Did you make your text box Dynamic?
this you give it an instance name as in the example? (in the example it was "age_txt"



my second frame has dynamic text box with instance name "age_txt" and no variable in the Var box.
my first frame has input text box with no instance name but with Variable "age"

I also tried doing this
Code: [ Select ]
if (age < 18) {
    this.age_text.text = age1;
    } else if (age >= 18 && input_age < 35) {
    this.age_text.text = age2;
    } else {
    this.age_text.text = age3;
}
stop();
  1. if (age < 18) {
  2.     this.age_text.text = age1;
  3.     } else if (age >= 18 && input_age < 35) {
  4.     this.age_text.text = age2;
  5.     } else {
  6.     this.age_text.text = age3;
  7. }
  8. stop();



instead of this


Code: [ Select ]
if (age < 18) {
    age_text.text = age1;
    } else if (age >= 18 && input_age < 35) {
    age_text.text = age2;
    } else {
    age_text.text = age3;
}
stop();
  1. if (age < 18) {
  2.     age_text.text = age1;
  3.     } else if (age >= 18 && input_age < 35) {
  4.     age_text.text = age2;
  5.     } else {
  6.     age_text.text = age3;
  7. }
  8. stop();





and this is what I get in the debug window for variables after typing 99 and pressing next:

Code: [ Select ]
Level #0:
Variable _level0.$version = "WIN 7,0,19,0"
Variable _level0.age1 = "It is Great To Be Young"
Variable _level0.age2 = "It is Great To Be an Adult"
Variable _level0.age3 = "It is Great To Be Wise"
Variable _level0.age = "99"
Edit Text: Target="_level0.age_txt"
    variable = null,
    text = ,
    htmlText = ,
    html = false, textWidth = 0, textHeight = 0, maxChars = null,
    borderColor = 0x000000, backgroundColor = 0xFFFFFF, textColor = 0xFFFFFF, border = false,
    background = false, wordWrap = false, password = false, multiline = false,
    selectable = true, scroll = 1, hscroll = 0, maxscroll = 1,
    maxhscroll = 0, bottomScroll = 1,
    type = "dynamic",
    embedFonts = false, restrict = null, length = 0, tabIndex = undefined,
    autoSize = "none",
    mouseWheelEnabled = true, condenseWhite = false, styleSheet = undefined
Button: Target="_level0.back_btn"
Variable _level0.back_btn.tabIndex = [getter/setter] undefined
Movie Clip: Target="_level0.back_btn.instance12"
Movie Clip: Target="_level0.back_btn.instance13"
Movie Clip: Target="_level0.back_btn.instance14"
Movie Clip: Target="_level0.back_btn.instance15"
Movie Clip: Target="_level0.back_btn.instance16"
  1. Level #0:
  2. Variable _level0.$version = "WIN 7,0,19,0"
  3. Variable _level0.age1 = "It is Great To Be Young"
  4. Variable _level0.age2 = "It is Great To Be an Adult"
  5. Variable _level0.age3 = "It is Great To Be Wise"
  6. Variable _level0.age = "99"
  7. Edit Text: Target="_level0.age_txt"
  8.     variable = null,
  9.     text = ,
  10.     htmlText = ,
  11.     html = false, textWidth = 0, textHeight = 0, maxChars = null,
  12.     borderColor = 0x000000, backgroundColor = 0xFFFFFF, textColor = 0xFFFFFF, border = false,
  13.     background = false, wordWrap = false, password = false, multiline = false,
  14.     selectable = true, scroll = 1, hscroll = 0, maxscroll = 1,
  15.     maxhscroll = 0, bottomScroll = 1,
  16.     type = "dynamic",
  17.     embedFonts = false, restrict = null, length = 0, tabIndex = undefined,
  18.     autoSize = "none",
  19.     mouseWheelEnabled = true, condenseWhite = false, styleSheet = undefined
  20. Button: Target="_level0.back_btn"
  21. Variable _level0.back_btn.tabIndex = [getter/setter] undefined
  22. Movie Clip: Target="_level0.back_btn.instance12"
  23. Movie Clip: Target="_level0.back_btn.instance13"
  24. Movie Clip: Target="_level0.back_btn.instance14"
  25. Movie Clip: Target="_level0.back_btn.instance15"
  26. Movie Clip: Target="_level0.back_btn.instance16"


still nothing shows up except for the back button, it's actually really interesting where the problem is, because I believe I did everything right... maybe they expected me to do something else but I didn't... like declare some variable somewhere in the code??? thank you for taking time to help me, if you think you know the answer then please let me know.
Moderator Remark: Please use [code][/code] to enclose that type of text so its easier to read
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Code: [ Select ]
} else if (age >= 18 && input_age < 35) {


according to what you said (and the example in the tute) input_age should be age.
You don't have a variable input_age

As a result it can't evaluate it properly.
  • seekthat
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

I took away input_ and left just age and still same problem...
you can leave this unresolved if it's getting annoying to you, but if you really want to help some more then it is fine with me :)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

It's never annoying to help people. Well, your code looks like the example if you fixed that. Do you have a way to upload your FLA somewhere we can take a look at it?
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

I tried to implement their example ( in flash CS4, for AS2), but when i trace the age var, i get something like this:
Code: [ Select ]
<p align="left"><font face="Arial" size="11" color="#ffffff" letterSpacing="0.000000" kerning="1">12</font></p>

So as workarounds you can have 2 ways:
1.
in a layer, place only one keyframe with the input text from the first frame, and for the same layer insert another frame (just a frame, not a keyframe), then set the instance name for your input text box as "inputAge".

Place the others elements just as in the example, then, in frame 2,
hide inputAge (inputAge._visible = false; ) and instead of age use inputAge.text;

2.
leave all elements as they are, only make this code on the Next button code to look like this:
Code: [ Select ]
on(release) { userAge = inputAge.text; gotoAndPlay(2);}


and in frame 2, instead of age, use userAge.

you can find this example here.
And if you still have problems you can download the fla for:
CS4 ver
CS3 ver
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

I know I'm late to the party but did you embed the fonts in the text field? Frequently text fields will just appear blank if you specify any font other than serif/san-serif and then don't embed the fonts.
  • seekthat
  • Newbie
  • Newbie
  • User avatar
  • Posts: 6

Post 3+ Months Ago

ATNO/TW wrote:
It's never annoying to help people. Well, your code looks like the example if you fixed that. Do you have a way to upload your FLA somewhere we can take a look at it?


here is what I have in my .fla file, since I can't send you the .fla file or post somehow, I'll just try doing it this way.

I have two frames and here is the code in actions layer
the first frame has this code only:


var age1:String = "It is Great To Be Young";
var age2:String = "It is Great To Be an Adult";
var age3:String = "It is Great To Be Wise";
stop();

the second frame has this code only:

if (age < 18) {
age_text.text = age1;
} else if (age >= 18 && age < 35) {
age_text.text = age2;
} else {
age_text.text = age3;
}
stop();

the button on the first frame has this code only and its instance name is next_btn :

on (release) {
gotoAndPlay(2);
}

the text box on first frame has these properties:
Input Text
Var: age
Instance Name: nothing here just blank


the button on second frame has these properties:
instance name: back_btn

and its code is:

on (release) {
gotoAndStop(1);
}

second frame has this Dynamic Text Box with these properties:
Instance name: age_txt
Var: nothing here
Single Line
Selectable: Checked
Render as html: not checked
show border around text: not checked

ok, :) now I found the problem myself, I misspelled the age_text.text they are suppose to be age_txt, I fixed it and now it works, thank you all for your help and patience, awesome website, definitely will come back and refer :)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Glad you got it! Yeah, noticed that on the typo right off. Don't you hate when that happens? Glad to have you at OZZU.

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 18 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
 
 

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