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

  • SEARCH
  • Home
  • 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 1102035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:07:19+00:00 2026-05-17T01:07:19+00:00

Actionscript: System.security.allowDomain(http:// + _root.tdomain + /); import flash.net.FileReferenceList; import flash.net.FileReference; import flash.external.ExternalInterface; import flash.external.*;

  • 0

Actionscript:

System.security.allowDomain("http://" + _root.tdomain + "/");
import flash.net.FileReferenceList;
import flash.net.FileReference;
import flash.external.ExternalInterface;
import flash.external.*;

/* Main variables */
var session_photos = _root.ph;
var how_much_you_can_upload = 0;

var selected_photos; // container for selected photos
var inside_photo_num = 0; // for photo in_array selection
var created_elements = _root.ph;
var for_js_num = _root.ph;




/* Functions & settings for javascript<->flash conversation */
var methodName:String = "addtoflash";
var instance:Object = null;
var method:Function = addnewphotonumber;
var wasSuccessful:Boolean = ExternalInterface.addCallback(methodName, instance, method);
function addnewphotonumber() {
 session_photos--;
 created_elements--;
 for_js_num--;
}

/* Javascript hide and show flash button functions */
function block(){getURL("Javascript: blocking();");}
function unblock(){getURL("Javascript:unblocking();");}

/* Creating HTML platform function */
var result = false;




/* Uploading */
function uploadthis(photos:Array) {

 if(!photos[inside_photo_num].upload("http://" + _root.tdomain + "/upload.php?PHPSESSID=" + _root.phpsessionid)) 
 {
  getURL("Javascript:error_uploading();");
 }
}




/* Flash button(applet) options and bindings */
var fileTypes:Array = new Array();
var imageTypes:Object = new Object();
imageTypes.description = "Images (*.jpg)";
imageTypes.extension = "*.jpg;";
fileTypes.push(imageTypes);

var fileListener:Object = new Object();
var btnListener:Object = new Object();
btnListener.click = function(eventObj:Object)
{
 var fileRef:FileReferenceList = new FileReferenceList();
 fileRef.addListener(fileListener);
 fileRef.browse(fileTypes);
}
uploadButton.addEventListener("click", btnListener);














/* Listeners */
fileListener.onSelect = function(fileRefList:FileReferenceList):Void
 {
  // reseting values
  inside_photo_num = 0;

  var list:Array = fileRefList.fileList;
  var item:FileReference;

  // PHP photo counter
  how_much_you_can_upload = 3 - session_photos;

  if(list.length > how_much_you_can_upload)
  {
   getURL("Javascript:howmuch=" + how_much_you_can_upload + ";list_length=" + list.length + ";limit_reached();");
   return;
  }

  // if session variable isn't yet refreshed, we check inner counter
  if(created_elements >= 3)
  {
   getURL("Javascript:limit_reached();");
   return;
  }

 selected_photos = list;

 for(var i:Number = 0; i < list.length; i++)
  {
   how_much_you_can_upload--;
   item = list[i];
   trace("name: " + item.name);
   trace(item.addListener(this));
   if((item.size / 1024) > 5000) {getURL("Javascript:size_limit_reached();");return;}   
  }

  result = false;
  setTimeout(block,500);

  /* Increment number for new HTML container and pass it to javascript, after javascript returns true and we start uploading */
  for_js_num++;
  if(ExternalInterface.call("create_platform",for_js_num))
  {
   uploadthis(selected_photos);
  }




 }


fileListener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void
{
 getURL("Javascript:files_process(" + bytesLoaded + "," + bytesTotal + "," + for_js_num + ");");
}

fileListener.onComplete = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void
{
 inside_photo_num++;

 var sendvar_lv:LoadVars = new LoadVars();
 var loadvar_lv:LoadVars = new LoadVars();
 loadvar_lv.onLoad = function(success:Boolean){

  if(loadvar_lv.failed == 1) {
  getURL("Javascript:type_failed();");
  return;
  }

  getURL("Javascript:filelinks='" + loadvar_lv.json + "';fullname='" + loadvar_lv.fullname + "';completed(" + for_js_num + ");");

  created_elements++;

  if((inside_photo_num + 1) > selected_photos.length) {setTimeout(unblock,1000);return;} // don't create empty containers anymore  
  if(created_elements >= 3) {return;}

  result = false;

  /* Increment number for new HTML container and pass it to javascript, after javascript returns true and we start uploading */
  for_js_num++;
  if(ExternalInterface.call("create_platform",for_js_num))
  {
   uploadthis(selected_photos);
  }
 }
 sendvar_lv.getnum = true;
 sendvar_lv.PHPSESSID = _root.phpsessionid;
 sendvar_lv.sendAndLoad("http://" + _root.tdomain + "/upload.php",loadvar_lv,"POST");    

}








fileListener.onCancel = function(file:FileReference):Void
{
}

fileListener.onOpen = function(file:FileReference):Void
{
}

fileListener.onHTTPError = function(file:FileReference, httpError:Number):Void
{
 getURL("Javascript:http_error(" + httpError + ");");
}

fileListener.onSecurityError = function(file:FileReference, errorString:String):Void
{
 getURL("Javascript:security_error(" + errorString + ");");
}

fileListener.onIOError = function(file:FileReference):Void
{
 getURL("Javascript:io_error();");
 selected_photos[inside_photo_num].cancel();
 uploadthis(selected_photos); 
}

<PARAM name="allowScriptAccess" value="always">
<PARAM name="swliveconnect" value="true">
<PARAM name="movie" value="http://www.localh.com/fileref.swf?ph=0&phpsessionid=8mirsjsd75v6vk583vkus50qbb2djsp6&tdomain=www.localh.com">
<PARAM name="wmode" value="opaque">
<PARAM name="quality" value="high">
<PARAM name="bgcolor" value="#ffffff">
<EMBED swliveconnect="true" wmode="opaque" src="http://www.localh.com/fileref.swf?ph=0&phpsessionid=8mirsjsd75v6vk583vkus50qbb2djsp6&tdomain=www.localh.com" quality="high" bgcolor="#ffffff" width="100" height="22" name="fileref" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></EMBED>

My uploading speed is 40kb/sec
Getting flash error while uploading photos bigger than 500kb and getting no error while uploading photos less than 100-500kb~.

My friend has 8mbit uploading speed and has no errors even while uploading 3.2mb photos and more.

How to fix this problem?

I have tried to re-upload on IO error trigger, but it stops at the same place.

Any solution regarding this error?

By the way, i was watching process via debugging proxy and figured out, that responce headers doesn’t come at all on this IO error.

And sometimes shows socket error.

If need, i will post serverside php script as well. But it stops at

if(isset($_FILES['Filedata']))
{

so it won’t help 🙂 as all processing comes after this check.

  • 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-17T01:07:19+00:00Added an answer on May 17, 2026 at 1:07 am

    Actually it WAS a server problem. A few weeks ago we moved on VDS with Ubuntu 10.04 with Apache and the problem disappeared by itself.

    On previous server, there were litespeed server with unix as I remember.

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

Sidebar

Related Questions

I have a code as below import flash.media.Sound; import flash.media.SoundChannel; flash.system.Security.allowDomain(*); var request:URLRequest =
is it possible using actionscript to determine what operating system the flash projector is
My simple ActionScript I am trying to use Flash's ExternalInterface to setup a callback
I'm writing a communication system, using Actionscript 3 and C#. Flash is used to
How to list down all the printers in system in ActionScript 3. as3 property
Flash ActionScript myData = new LoadVars(); myData.onLoad = function() { myText_txt.text = this.myVariable; };
In working on larger Actionscript/Flash projects, I've started to really feel the need for
I have a nicely working actionscript project in Flash Builder 4.5. However, I'd like
I am trying to use POST in Flash (ActionScript 2), to POST values to
I just started programming flash/actionscript and I am confused as to what the meaning

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.