Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:29:45+00:00 2026-06-13T11:29:45+00:00

Ok so I have a debug system I am working on for a flash

  • 0

Ok so I have a debug system I am working on for a flash game, and I have a Switch(case) block in there here is what I have so far.

switch (fstring){

case "player.getname":
var pname = _global.heroVars.playerName;
target.feedback.text +=  (ct + pname + "\r\n");
target.inputt.text = "";
break;

case "player.getlevel":
var plevel = _global.heroVars.userLevel;
target.feedback.text += (ct + plevel + "\r\n");
target.inputt.text = "";
break;

default:
target.feedback.text += (ct + "\"" + inp + "\"" + " is not a valid function\r\n");
target.inputt.text = "";
}

My question is how can I make one so it’s a “Set” function. For instance
“player.setlevel NUMBERHERE” or “player.setname STRINGHERE” etc. And take the 2nd part of a the string and use said number or string to set a variable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:29:46+00:00Added an answer on June 13, 2026 at 11:29 am

    Found out how to do it.

    With the example of this string “_player.addlevels 2” as the var inputFunc

    var mystring:String = inputFunc; // sets it to a new var to not mess up the original
    var sepString:Array = mystring.split(" "); // splits "_player.addlevels" and "2"
    var func:String = sepString[0]; // sets this string to "_player.addlevels"
    var inputVar:String = sepString[1]; // sets this string to "2" which can be anything and cast into another var type
    
    switch(func){ // takes our variable with the string "_player.addlevels"
        case "_player.addlevels":
            _global.playerLevel += int(inputVar); //since they are using this function we know that they are using and integer and thus cast the string to an int
        break;
    }
    

    Don’t know how I didn’t see it before but I ended up solving my own problem. So there’s the answer in case anyone is curious

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following ( doctored ) class in a system I'm working on
I'm working on an application for my distributed system laboratory course. I have a
Mornin', I'm trying to just get basic encryption working using System.Security.Cryptography.RjindaelManaged. I have google
OK, I have been working on a random image selector and queue system (so
I have this program here: namespace TodoPlus { using System.Diagnostics; public class LameProg {
we have here some problems with our Magento system. First the background : We
I am writing a desktop and j2me application. I have debug statements in program.
I have to debug a problem with Windows DLLs, but I'm running Linux exclusively,
I have to debug a c++ project, but as one dependency doesn't compile in
I have to debug a classic asp site being served by IIS 7 (windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.