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 9084511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:01:02+00:00 2026-06-16T21:01:02+00:00

I am working on a project that uses a batch script to check availability

  • 0

I am working on a project that uses a batch script to check availability (ping) of the computers in a specific Network. It also changes the color of an object in Flash-based UI when there’s an exact match from the script’s results.

EXAMPLE:

1) Script runs checks and outputs into results.txt:

192.168.0.1=UP

192.168.0.2=DOWN

192.168.0.3=UP

2) Using AS3, I would like to read this file and search for a string like “192.168.0.1=UP”. If there is a match it would change the object’s color to GREEN. Otherwise, it would set as RED.

So far, I have managed to import the output file from the script inside Flash, using:

var textLoader:URLLoader = new URLLoader();
textLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
trace(e.target.data);
}
textLoader.load(new URLRequest("Path:/To/result.txt"));

I understand I cannot just make AS3 search the file only for “192.168.0.1=UP” and change color if there is match.

How I can make use of the imported text? Do I have to make a string, that uses only the parts of the text I need and then make an IF statement to color the object if there is match?

Thanks in advance.

UPDATE:

Thanks to Gunther Fox, I was able to put the whole code together:

import flash.geom.ColorTransform;

var textLoader:URLLoader = new URLLoader();
textLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
    trace(e.target.data);
    if (e.target.data.indexOf("192.168.0.1=UP") != -1) {
        var colorGREEN:ColorTransform = <instance_name>.transform.colorTransform;
        colorGREEN.color = 0x00FF00;
        <instance_name>.transform.colorTransform = colorGREEN;
    }
    else {
        var colorRED:ColorTransform = <instance_name>.transform.colorTransform;
        colorRED.color = 0xFF0000;
        <instance_name>.transform.colorTransform = colorRED;
    }
}
textLoader.load(new URLRequest("Path:/To/result.txt"));

Now my AS3 changes color of a specific object, based on the batch script output.

UPDATE 2

I solved the problem with reloading of the text file:

var timer:Timer = new Timer(10000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();

function onTimer(evt:TimerEvent):void {
var textLoader:URLLoader = new URLLoader();
textLoader.addEventListener(Event.COMPLETE, onLoaded);
textLoader.load(new URLRequest("C:/Folder/output/result.txt"));

}
  • 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-16T21:01:03+00:00Added an answer on June 16, 2026 at 9:01 pm

    If you’re looking for something very specific like the string “192.168.0.1=UP” you can use indexOf() and check if the result is -1 or not:

    function onLoaded(e:Event):void {
        trace(e.target.data);
    
        if (e.target.data.indexOf("192.168.0.1=UP") != -1) {
            // Change to green
        }
        else {
            // Change to red
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project that uses several languages: SQL for querying a database
I'm working on a project that uses the new CSS3 transform:rotate(180deg) feature. Every modern
I am working on a project that uses Java Swing. The default look and
I'm working on a project that uses dependency injection via Ninject. So far, it
I'm working on a project that uses Linq2SQL for data access. The project is
We use Subversion locally, and we're working on a project that uses a fork
I am working with a C# project that uses the dll, Microsoft.Dynamics.AX.ManagedInterop to work
I'm currently working on a JavaScript project that uses the HTML5 canvas as a
I am working on a Silverlight project that uses Django on the server using
If I'm working on a cross-platform project that uses dbus-java, what do I need

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.