Strict Data Typing
Hi all!
Anyone know if it's possible to specify a choice of data types for a particular variable?
For example, to specify that a variable called 'my_mc_depth' must receive numbers, I would use:
ActionScript Code: var my_mc_depth: Number = my_mc.getDepth ();
However, the new MovieClip method 'getInstanceAtDepth ()' can return values of either 'String' or 'undefined' types, so can I set up a variable to accept values of 'String' AND 'undefined' types?
[goes away scratching head...]
Ultrashock Forums > Flash > ActionScript
Posted on: 2003-10-23
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Strict Data Typing
What are your thoughts on Strict data typing? I uise it as much as possible, check out the article I wrote about it on my blog: Why strict data typing is good
[F8] Strict Data Typing
if you use variables that are not strict data typing , to those that are strict data typed. Will this decrease memory and processing time when doing complicated or heavy stuff.
Sometimes scripts I run do a lot of mouse detection, and movieclip movement, and sometimes will lag if i try to do too much with it. I usually dont strict data type my stuff and i was wondering before I go all in and try to change a million things if its actually going to help or not.
Strict Data Typing? I Don't Think So.
Hi,
Flash MX2004 Pro is giving me a problem. When I add two numbers together, Flash is concatenating them as a String.
I shall go through the process:
I am loading in two values from a database. The column type is INT(10).
I pass these values into Flash via:
PHP Code:
print "&{$key}={$value}";
These values arrive in my LoadVars object like this:
Code:
Variable _level0.city = [object #159, class 'LoadVars'] {
property_id:25,
onLoad:[function 'onLoad'],
origin_x:"434750",
origin_y:"387250",
success:"1"
}
The vars I am interested in are origin_x and origin_y (note they are a String data type now).
When the LoadVars object has finished loading, I do:
Code:
_root.origin = new Array(_root.city.origin_x, _root.city.origin_y);
_root.load_tiles(_root.origin);
The load_tiles() function:
Code:
function load_tiles(origin)
{
var x:Number = origin[0];
var y:Number = origin[1];
load_tile(x, y, 1);
x += 500;
// ... etc
Even though I am casting the vars as Numbers, Flash still treats them as Strings!
The first tile loads fine, but when I try to add the 500 to var x, I get a concatenated string.
How can I resolve this?
I really don't understrand - PHP is a weakly-typed language, but it always does what I want it to do.
Thanks,
Strict Data Typing And Trace()
I am in the midst of creating a news scrollbar in flash and am looking at the getTextExtent() function. Trying to learn how to use this is proving difficult however, in the help section they give the following example:
Quote:
var my_str:String = "Small string";
if i try to:
Quote:
trace(my_str);
it returns undefined.
Why is this happening?
Strict Data Typing For AS2 Newbie
i get the concept of data typing such that:
Code:
// create myVar as a string
var myVar:String = new String();
Totally understand that. My question is how does one define a variable as a property of an object with strict typing?
Without typing the variables i'd just do this:
Code:
// create new object
myObject = new Object();
myObject.newProperty = "Some Value";
How would I do the equivalent with strict data typing
Strict Data Typing Questions
how do i strict data type an array ?
how do i strict data type a dynamic text field that uses the html property?
Code:
txtField.htmlText = "help";
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
array0 = New Array;
array0[0] = "help0";
array0[1] = "help1";
array0[2] = "help2";
Strict Data Typing Within An Object
Hey. So - You've created an object. Now you want to have a property of the object - and you want that property to have strict data typing because you're picky. Here's the code you've written.
var oTest:Object = new Object();
oTest.nThing = new Number();
oTest.nThing = 1;
trace(oTest.nThing); // output = 1
oTest.nThing = "word";
trace(oTest.nThing); // output = word
And there you run into a problem. You want the output of the second trace statement to be NaN / undefined. The variable within the object is not strictly typed. How do you fix this silly mistake you've made??
:-p
thanks!!
Dynamic Variables In Strict Data Typing
I am trying to use dynamic variables with strict data typing.. does anyone know how to do this?
here is my code:
PHP Code:
var nc_1:NetConnection = new NetConnection();
trying to achieve this:
PHP Code:
v = 1
var _root["nc_"+v]:NetConnection = new NetConnection();
Strict Data Typing A Combobox...error.
Hey all,
I have a combobox named:
moduleDropDown
Here is what I did in actionscript:
var moduleDropDown:ComboBox;
This is the error I get when I test my movie:
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 11: The class or interface 'ComboBox' could not be loaded.
var moduleDropDown:ComboBox;
Total ActionScript Errors: 1 Reported Errors: 1
Can anyone tell me what I did wrong?
Thanks.
Variables Not Working When Strict Data Typing
Have the following code that does't work when angle and speed uses strict data typing. Hope someone can help me understand ....
PHP Code:
init();function init():Void{angle = -40; // does't work if ''var angle:Number = -40;''speed = 5; // does't work if ''var speed:Number = 5;''ball = attachMovie ("ball", "ball",0);ball._x = Stage.width / 2;ball._y = Stage.height / 2;}function onEnterFrame():Void{var radians:Number = angle * Math.PI / 180;var vx:Number = Math.cos(radians) * speedvar vy:Number = Math.sin(radians) * speedball._x += vx;ball._y += vy;}
Syntax Question, Strict Data Typing With Dynamic Var Name
Code:
var shapeList:Array = [];
/**
* Generate a new name for object that I am storing for
* the first time
*/
var pointer:String = "Obj" + shapeList.length; // first run is "Obj0"
/**
* Create an Array object with the generated name, and
* use it to store all info about the object.
*/
// three incorect syntax below
var pointer:Array = [] // error!! "type mismatch"
var (this["Obj" + shapeList.length]):Array = []; // error!! "Identifier expected"
var eval(["Obj" + shapeList.length):Array = []; // error!! "syntax error)
I want to generate a dynamic name for an Array. It is inside a class and every variable must be explicitly type set via strict data typing. What is the correct syntax for creating a Array with the name of the Array being a dynamic string?
thanks
--mm
Strict-typing
Hi guys.
I was just wondering if you strict-type your AS or avoid it in order to use the (sometimes very handy) prototyping.
Most of the time I strict-type because of the obvious reasons for doing so but recently I've found that a few prototypes have come in really handy, but they don't work when strict-typing.
Any thoughts or views on Strict-typing Vs Prototyping?
Prototype With Strict Typing
Could someone please explain why strict typing produces an error in following code:
ActionScript Code:
Number.prototype.testproto = function():Number
{
return this;
};
ASSetPropFlags(Number.prototype,["testproto"],1);
var myNo:Number = 33,
myTest:Number = myNo.testproto();
trace("myTest resulted in " + myTest);
Resulting error:
Quote:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: There is no method with the name 'testproto'.
var myNo:Number = 33,
Total ActionScript Errors: 1 Reported Errors: 1
Prototypes And Strict Typing
How can I get a prototype working with a strictly typed variable?
Say I've written an ltrim function as in the code sample below. If I define a string with no typing, the function works fine, but If I define a string as type String - the complier breaks?
Cheers,
FlashTastic
Attach Code
String.prototype.ltrim = function(){
while(this.charAt(0) == " "){
this = this.substr(1,this.length);
}
return this;
}
//***** THIS WORKS
var str1 = " lots of spaces left";
str1 = str1.ltrim();
trace(str1);
//traces "lots of spaces left";
//***** THIS DOESN'T
var str1:String = " lots of spaces left";
str1 = str1.ltrim();
trace(str1);
//compiler throws an error "There is no method with the name 'ltrim'".
Using AS 2.0 - Flash CS3
Strict Typing | Type Mismatch - But Why?
ActionScript Code:
function myFunction():Void { var myMC:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth()); var myTxt:TextField = myMC.createTextField("txt", 0, 20, 20, 0, 0);}
The above function returns the error below:
Quote:
Type mismatch in assignment statement: found Void where TextField is required.
But I don't understand why.
As far as a work-around, I can just reference the 'mc' movieclip by its actual instance name, that wont be a problem as of yet. but if there was a situation where i wanted to reference the movieclip by this 'myMC' variable, like i'm attempting to above, how would it be done?
thanks for any help in advance.
Speed In FMX04 And Strict Typing
heh, well, I was really bored, so I decided to run a few tests on the differences in speed in FMX04 between a strictly typed variable and a non-strictly typed variable... the differences were amazing.
I used these two pieces of code:
ActionScript Code:
for(var num:Number = 0;num<50000;num++){ 56+51; 21+23; 53+21; if(num == 4999){ var totalTimeDefined = getTimer(); }}for(var num2 = 0;num2<50000;num2++){ 56+51; 21+23; 53+21; if(num2== 4999){ var totalTimeNotDefined = getTimer(); }}trace(totalTimeDefined);trace(totalTimeNotDefined-totalTimeDefined);
The output varied between 200 and 170 and 900 to 1100 on my P3 700. I'm sure the difference would get bigger and bigger as the iterations got bigger, but don't quote me on that.
I just thought some of you might find this interesting.
The moral of the story is: always use strictly typed variables when you can in 04
Strict Typing In Flash Mx 2004
var test:String = "Open";
that works, and is simple
but how would i get an anonymous object properties to have a strict type
these work:
array2 = {label:"Open", instanceName:"OMenuItem"};
var array2:Object = {label:String:"Open", instanceName:String:"OMenuItem"};
but the following don't work, i want label and instanceName to have a String type
these do NOT WORK:
var array2:Object = {label:String:"Open", instanceName:String:"OMenuItem"};
var array2:Object = {var label:String:"Open", var instanceName:String:"OMenuItem"};
var array2:Object = new Object() ;var array.label:String = "Open";
someone plz clarify if this is possible in MX 2004?
Strict Data Type Function
how would you call this variable??
Code:
var myFunct:Function = function():Void
{
trace("function called");
}
Another Strict Data Type Question
Do i only use strict data typing for variables?
Because if i try to use it with the following code I get an error
Code:
btn.onPress:Button = function(){
}
Please give me an example of how to use strict data typing using the :Button data type.
Poll For Pros: Strict Data Type?
If you're a pro, do you use strict data typing? (please keep it short)
If you've been programming for years the error-checking isn't a benefit so please don't factor that in. Is there any new reason to do it in 8? I'm seeing both ways everywhere and want to get a consensus.
I personally haven't run into any use for it so I've stopped doing it - just extra characters.
Trigger Code Hinting On Strict (or Strong) Data Types
Hey!
I've seen Lee get back the code hints whenever his is typing some code on the timeline. For instance
var bmp:BitmapData = new BitmapData(foo._width, .... get back code hints here!, ...... );
What is the command/key stroke to get those back? I tried hitting control-spacebar like the livedocs say, but that only works if no params have been entered.
Any help?
cheers.
:)
Dynamic Data Typing...
Here is something for you to play around with....
I will give you a little idea... and see what you guys can do to come up with stuff.
The only reason I'm not going to go into detail with this is, I gotta keep some of us programmers job security safe . This is merely to inspire.
ActionScript Code:
var myClass:Function = Array;
var myArray:Object = new myClass();
trace( myArray instanceof myClass);
myArray.push(5);
myArray.push(10);
trace( myArray );
I may come back with a more elaborate example... but I may not... enjoy
TakeCare...
_Michael
Dynamic Data Typing..
Here is something for you to play around with....
I will give you a little idea... and see what you guys can do to come up with stuff.
The only reason I'm not going to go into detail with this is, I gotta keep some of us programmers job security safe . This is merely to inspire.
ActionScript Code:
var myClass:Function = Array;var myArray:Object = new myClass();trace( myArray instanceof myClass);myArray.push(5);myArray.push(10);trace( myArray );
I may come back with a more elaborate example... but I may not... enjoy
TakeCare...
_Michael
Strong Data Typing Questions
I'm trying to use strong data typing and abosolute paths to make my code as clean as possible I've used what i know below but an wondering if there is more that i need to do also i need a website or resource that lists all the strong data types....the only ones i know are String,Number, and Object are there more where do i find information about strong data typing and making my code clean? I'd appriciate any insight you have on this subject.
Code:
output_txt.htmlText = "";
function output(arr){
var len:Number = arr.length;
for( i:Number=0; i<len; i++){
output_txt.htmlText += "Element " + i + ": " + arr[i] + "<br>";
}
output_txt.htmlText += "<br>";
}
var help:Array = new Array();
help[0]= "Help!";
help[1] = "The Night Before";
help[2] = "You've Got to Hide Your Love Away";
help[3] = "I Need You";
help[4] = "Another Girl";
help[5] = "You're Going to Lose That Girl";
help[6] = "Ticket to Ride";
help[7] = "Act Naturally";
help[8] = "It's Only Love";
help[9] = "You Like Me Too Much";
help[10] = "Tell Me What You See";
help[11] = "I've Just Seen A Face";
help[12] = "Yesterday";
help[13] = "Dizzy Miss Lizzie";
output(help);
Strong Typing XML Data In Settings Class
Hi,
I have a Settings class which loads an XML file. The XML file contains nodes with 3 attributes - type, value and key. For example:
Code:
<myNode type="String" key="copyright_txt" value="This is copyright of somebody somwehere" />
In my Settings class I have a public function:
Code:
getSetting(key:String):Object{
//Match key and return value;
}
It runs through the XML and returns the value of the node with the matching key.
My problem is that the returned item is always Typed as Object. Is there any way I can Strongtype the returned value without having to have separate getter functions for separate types?
Thanks
Data Typing A Dynamic Text Field
I am seeing the fofllowing error when I load a variable into a dynamic text box.
1067: Implicit coercion of a value of type Number to an unrelated type String.
I know that I need to data type the text box and I thought I could do it like:
Number(score_txt.text) = score;
But that isn't working and I cannot find anything in the documentation on it.
Can someone help please.
Mike
Ghost Typing (or Self Typing Text)
I am new to Flash and was wondering if anyone knows a less than incredibly tedious way to set up a body of text to animate as if being typed by a "ghost typer" (for lack of better terminology). You have seen this all before in any movie with computers... the text scrolls across the screen letter by letter, stops, goes away, and then a new scroll of text appears on the screen, as if someone was entering the text while you were reading it. I have figured out one way by giving each letter a frame and animating that sequence, but this is incredible tedious and time consuming. If anyone has a better method please let me know. Thanks.
Strict IDE?
Hey, I've been using Flash 8 for a while now, but I was wondering what's better for coding? Almost my entire project is classes, since I'm into programming Java and C++. I've noticed theres no warning or error for calling functions to objects that don't exist (undefined) and you can leave semicolons off the end of statements, etc. I want something more strict and concentrated on the coding. Which would be better for me, Flash 8, Flex, Eclipse or other?
I can still make a .fla in Flash 8 with my classes even if it's done in Flex or Eclipse right?
XHTML Strict
Hi,
I'm redoing a site that has some Flash movies and am trying to figure out how to make them validate in XHTML strict. I found one website that seemed to have some nice information about it (here, if you're interested) and it does seem to work but I'm worried that some of the stuff I had to leave out might be important. The original tag was:
Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="180" height="195" style="float:left; ">
<param name="movie" value="../_psychology-movies/abusechild2.swf" />
<param name="quality" value="high" />
<embed src="../_psychology-movies/abusechild2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="180" height="195"></embed>
</object>
And the new tag is:
Code:
<object type="application/x-shockwave-flash" data="../_psychology-movies/abusechild2.swf" width="180" height="195" style="float: left; ">
<param name="movie" value="../_psychology-movies/abusechild2.swf" />
<param name="loop" value="false" />
alt : <a href="../_psychology-movies/abusechild2.swf">abused-child.swf</a>
</object>
Do I need to be concerned about any of the stuff I had to leave out? Specifically, if people don't have a Flash player on their machine, will they still be prompted for it? And is there a better way to do this or is this it?
Thanks.
Strict Or Not Scrict
This is a several part question. First, how many people turn off the strict warning messages? Second, is it alright to turn strict off? Am I losing the speed benefits? Also, is this an alright way to learn AS3 coming from AS2? And last, what errors should I avoid, or what should I make sure to do even in non-strict AS3?
Strict Mode
I'm working in a book (Visual Quickpro Guide Flash CS3 Professional Advanced). Many of the examples throw errors (all the examples are in AS3). However, I've found that if I uncheck the "strict mode" box in the publish settings the errors go away. I've downloaded the example .flas from the books website to confirm this and indeed they have the box unchecked and their code is identical to mine. Whenever I create a new Flash file the strict mode box is checked by default. So I'm wondering, what exactly does the "strict mode" indicate and is it best to always leave it unchecked. To my thinking, examples in a published book should not throw errors, even in "strict mode." This indicates to me that something is wrong with the code. But, not knowing enough about what "strict mode" indicates maybe I'm being too harsh on the author. Any insight would be greatly appreciated. Thanks.
A .swf In Valid XHTML Strict
Alright, I'm trying to put a soundloop on my blog, but I want it to remain XHTML 1.0 strict.
'Strict' doesn't allow Iframes, and transitional gives me errors.
I have tried
<iframe name="music" width=75 height=50 src="http://moments.mo.funpic.org/nucleus3.2/skins/stanch/player.html" frameborder=0></iframe>
But I get a SHORTTAG error on transitional.
Is there any way to call a .swf (with defined width and height) while remaining XHTML strict?
Why Detection Kit Is Not Xhtml Strict?
Hi,
we designed an xhtml strict website.
The macromedia detection script is not valide for the w3c xhtml standard.
Why?
http://validator.w3.org/check?verbose=1&uri=http%3A//www.vangogh-creative.it/premiowww/index.html
Strict Datatyping With Arrays
anyone know the syntax for creating an array of a certain type?
I'm defining a class, and I want to strict datatype an array so that all the elements of that array are instances of that class
How Do You Disable Strict Mode
I see in several places in the documentation references to two compiler modes and the differences between them laid out. What I don't see is any information as to how to compile in standard mode. One post on the forum said there was a checkbox in publish settings, which I definitely don't see.
Strict Datatyping Question....
Hi there, i have the following code in a class:
var stringComparer:String = Config.DisabledPages[index]
The part "Config.DisabledPages[index]" is a direct reference to a static attribute in the class "Config".
My problem: I traced the datatype of the static property like this:
typeof(Config.DisabledPages[index]);
It answered that it is of type Object, so not string. But Flash doesn't produce an error that there is a wrong datatype being used foor stringComparer.
Probably a simple question, but I honestly dont know why it doenst work....
Flash And Its Non-strict OOP Scope
I was writing some stuff today and i realized that variables inside a class are not constrained to the constructor or method scope. In my opinion this is utter lazynes. Scopes need to be fully enforced to force programmers to comply with correct OOP styles and organization.
to force yourslef to comply with the standards, when reffering to the consturctor always use the 'this' prefix and use 'var' for all temporary variables that should be inside the method scope.
Root In Strict Mode
im trying to code a game in strict mode, but one thing is troubling me, how do you make a reference to the root in strict mode????
Flash + XHTML 1.0 Strict
Right
After seeing the amazingly bloated code that flash generates to display a movie inline with a webpage, I went searching and came accross an article on ALA which outlines this code:
Code:
<object type="application/x-shockwave-flash" data="logoanimation.swf" width="130" height="100">
<param name="movie" value="logoanimation.swf" />
<img src="images/noflash.gif" width="130" height="100" alt="" />
</object>
Now that works really well! (NN4 + Mozilla 1.3 + IE 6) and has the bonus that if flash isn't supported it loads up the 'failsafe' gif image
So what's the deal? is it okay to do it this way?
I've got it up and running here and that page validates as XHTML 1.0 Strict at the moment (not finished though heh)...
Flash Rendering With XHTML Strict DTD
This is more of an annoyance than a problem, since the site renders properly in transitional. I have a flash object that flows into the rest of the site design but when I use a strict DTD there is a 3 pixel margin between the flash object and the rest of the site. It renders perfectly in IE (for once) but not in firefox. I can't figure out what's causing the gap. Any ideas?
Strict Datatyping Global Vars
Hi all
I am trying to do some addition with some values which are saved in global variables, like so:
Code:
x_max = _global.imgWidth;
MARGIN = 10;
bck_btn._x = x_max + MARGIN;
..so that i have a back button 10px to the right of a dynamically loaded image. Only problem is that the numbers are concatenating instead of adding.
I have read on livedocs that it is not possible to strictly datatype a global variable. Anyone know a way around this?
Any help is appreciated greatly
Making Peace With Strict Mode
how do i tel strict mode that i spect some thing to be in consistent. for example im changing a property of a movieclip that dosen't yet exist. i will create it it later thru actionscript.
btw: whats wrong with this.
ActionScript Code:
MovieClip.prslide.y += speed;
pr slide is an instance name of a movie clip on the main timeline.
[F8] Strict Type And Dynamic Text Fields
Hi
I was wondering what the best way is of doing this:
Say I am using a dynamic text field to display a message. If I create the text field on my stage and give it an instance name in the properties panel should I declare that variable in the script as well? If I am trying to stick to the strickt data typing way of doing things?
I mean, say the instance name of my text field is message_txt, should I create an action on the frame -
var message_txt:String;
or is this overkill?
Help Strict Datatype Dynamic Objects And Their Properties
I'm creating a bunch of objects dynamically in a for loop:
Code:
for(k:Number = 0; k < someothernumber; k++) {
this[nomObj + k] = new Object();
this[nomObj + k].subname = "some string value";
}
How can I strict datatype the object declaration and the property? Is that possible? If I use the colon syntax for strict datatyping, the code breaks.
I found this thread, but it doesn't really discuss strict datatyping of the object properties:
http://www.actionscript.org/forums/s...light=datatype
Thanks for your help -- this is one of my first true AS 2.0 Flash projects, and I'm trying to be diligent with the strict datatyping.
IronChefMorimoto
Temp.as / Changing Compiler Strict Mode
I was getting the following error:
1067: Implicit coercion of a value of type Class to an unrelated type String.
It said it appeared at Line, 1 in temp.as
It turned out the problem was I was, indeed, trying to assign a class name (I forgot to put the static function name) to string typed variable at a frame code section of a MovieClip.
I would say, withouth actually knowing anything at all about inner workings of Flash, the temp.as is created for the code inside frames. So temp.as may suggest you to look in there (not in the other 20 class files of your current project which deadline is approaching end).
Also, in order to debug it and get more information about it I needed to change the AS3 compiler settings to not compile at strict mode. This is how:
File->Publish Settings...->Flash Tab->Settings...->Strict Mode (uncheck it)
The settings button under the Flash Tab is right next to a combo box that lists the versions of ActionScript.
Hope this will help someone!
Jorge
How To Embed Flash On XHTML 1.0 Strict, But Valid.
I have a problem with a web page that i am making, seems that the code that flash creates when publishing a project is not validating with xhtml 1.0 Strict and xhtml 1.0 Transitional doctypes. Any idea how to fix this ?
Transparent Background Movie - For XHTML Strict
Hi all -
I know that you can change the window property to transparent, when you are publishing a movie..
But i am not using the publish movie html code, that they use as its not XHTML strict..
Anyone know what to add to this code to make my movie transparent?
<object type="application/x-shockwave-flash" data="Flags.swf" width="180" height="220">
<param name="movie" value="Ballsicons2.swf" />
<img src="altflags.gif" width="180" height="220" alt="alt image" />
</object>
Ive tried adding this as another line in that code:
<param name="wmode" value="transparent">
and this to my object type line(first line):
wmode="transparent"
That doesnt work either (;(
Any suggestions?
thanks!
d
Embedding Flash In Xhtml Strict Code?
Does anyone know how to embed a flash .swf into a xhtml 1.0 strict DTD without getting errors upon validation? It seems I always get some error relating to to the param or embed tags.
Impossibly Strict Crossdomain Settings Won't Even Let Me Access My Own Domain
Hey. I'm trying to connect to a service using sockets on the same domain, using the same hostname as the one from the URL.
I understand you need to setup a crossdomain.xml file, which I have as:
Code:
<?xml version="1.0" ?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="mydomain" to-ports="2055" />
<allow-access-from domain="mydomain" to-ports="80" />
</cross-domain-policy>
"mydomain" is set to my actual domain I'm using in the request.
Loading of the policy file is the first line of the program.
Code:
Security.loadPolicyFile("http://mydomain/crossdomain.xml");
I've tried running the program with and without this, to no effect.
Please note that I'm careful not to connect to www.domain.com where the policy is set for domain.com .. I understand that would be two different domains.
Opening a socket connection to mydomain:2055 fails with a security notice, and so does even connecting to port 80! How is this? Are sockets just banned now? I definitely was able to use them when I ran the SWF file on my local machine, however, when running the flash from my HTTP server, it fails with the following error message:
Code:
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://mydomain/flash.swf?time=1210606828252 cannot load data from mydomain:2055.
at Main()[D:flashMain.as:1024]
Like I said above, it will also fail when connecting to 80 (using Sockets) as well. I feel that it's not an actual transmission error, since it says 'sandbox violation'. And also how on earth could there be a transmission error to 80 when that's where the http server is!
Any ideas? Thanks for reading!
Kyle White
|