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

User defined variables, and random classes?

New Here ,
Apr 29, 2015 Apr 29, 2015

I‌ have a question about Actionscript 3.0.

I have some experience with JavaScript, and I know that you can make JLabels, and make it to where whenever someone types something into it, it saves exactly how they wrote it.  You can then go forward, and recall this variable anytime you want.

is there a way to do this in Adobe Flash using ActionScript 3.0?  If so, how can I go about doing it?

as another question that I would love to know -- how do you make it to where you can import random, and use it.  Or would it already be imported? 

by random, I mean something where I can make pick a random variable, and then go ahead and play something based on random choice.

As an example, let's say I'm trying to make a text adventure game in Adobe Flash.  I want to make something where a player can type in their name, and then I can recall it later on in the code.

As a random, an example would be exploring in this said game.  Maybe the player chooses to explore a forest, so they do.  Do they run into a monster?  Find some loot?

I've tried to look around, but I can't seem to find anyway to do alol of this using Actionscript.  Thank you so much in advance!

TOPICS
ActionScript
214
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 ,
Apr 29, 2015 Apr 29, 2015
LATEST

you can create an input textfield, assign text to it and then assign listeners that detect when the textfield receives focus so you can remove that text and save the text the user entered.

and the Math class does not need to be imported.  just like javascript you use the static methods and they're all the same (afaik/remember).  eg, Math.random() is the same in actionscript as javascript.

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