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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:13:09+00:00 2026-05-13T19:13:09+00:00

I’m bad with strings and probably messed this up. My Flash file receives XML

  • 0

I’m bad with strings and probably messed this up. My Flash file receives XML commands and changes the value of the animations (speed, time). Can you improve this string argument or give me an idea what I need to do differently.

XML

    <head>
    </head>
    <body>
    <cnt>1count*count/10</cnt>
    </body>

IS THIS RIGHT?

                    //XML ==> STRING   
var string_tangle:String = xml_msg.body.cnt; //LINE 27

                    //STRING ==> url request    
var urlReq:URLRequest = new URLRequest(string_tangle); //LINE 28

                    //VALUE ==>       
fcount=int(urlReq);<br> //GOES TO LINE 49 "urlReq instead of (1count*count/10)"
 

myloader.swf

//METHODS
import flash.net.*;
import flash.display.Loader;
import flash.events.*;
import flash.system.Security;

var xml_s=new XMLSocket();
xml_s.addEventListener(Event.CONNECT, socket_event_catcher);//OnConnect//
xml_s.addEventListener(Event.CLOSE, socket_event_catcher);//OnDisconnect//
xml_s.addEventListener(IOErrorEvent.IO_ERROR, socket_event_catcher);//Unable To Connect//
xml_s.addEventListener(DataEvent.DATA, socket_event_catcher);//OnDisconnect//
xml_s.connect("localhost", 1999);

//MY SOCKET
function socket_event_catcher(Event):void
{
    switch(Event.type)
    {
        case 'ioError':
            trace("ioError: " + Event.text);  //Unable to Connect :(//
            break;
        case 'connect':
            trace("Connection Established!");  //Connected :)//
            break;
        case 'data':
            trace("Received Data: " + Event.data);
            var xml_msg:XML = new XML(Event.data);
            var string_tangle:String = xml_msg.body.cnt;
            var urlReq:URLRequest = new URLRequest(string_tangle);
            //fcount=int(urlReq);
            break;
        case 'close':
            trace("Connection Closed!"); //OnDisconnect :( //
            xml_s.close();
            break;
    }
}
//////////////////////////////////////////////////////////////
//MY TIMER
var timer:Timer = new Timer(10);  
var count:int = 0; //start at -1 if you want the first decimal to be 0  
var fcount:int = 0; 

timer.addEventListener(TimerEvent.TIMER, incrementCounter);  
timer.start();  

function incrementCounter(event:TimerEvent) {  
  count++; 
  //WANT TO CHANGE THIS IN LINE 50//fcount=int(urlReq);
  fcount=int(count*count/1000);
  mytext.text = formatCount(fcount);
}

function formatCount(i:int):String { 
     var fraction:int = i % 100; 
     var whole:int = i / 100;  
    return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); 
}

ERRORS "may have broke something. It worked fine before I rewrote it.
security sandbox violation
Error #2031: Socket Error

  • 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-05-13T19:13:09+00:00Added an answer on May 13, 2026 at 7:13 pm

    It is most likely a violation of Adobe Security Policy.

    Try changing your security settings in your flash player or follow this link to do it:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

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

Sidebar

Related Questions

No related questions found

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.