-
-
Senior Member
You'd probably get more help is you posted in the AS3 forum..since you want an AS3 solution....
-
Actually, I want an AS2 solution that works in CS3, which is different from an AS3 solution...
I was able to use this AS3 tutorial:
http://www.kirupa.com/developer/flas...ml_as3_pg1.htm
Using that, I got as fat as having armory info show in the Output box.
But then, AS3 doesn't let you set a textfield variable in the Properties panel, so I'm lost again. this type of thing is exactly why I need it to be in AS2.
-
If you were to publish the SWF and reload the widget in your browser now, you would encounter the good ol' security sandbox violation error, one of my personal favorites. Actually if you didn't setup a debug player and logging you wouldn't really see anything much at all. It just wouldn't work. If you are tailing the flashlog.txt file, you see this:
requesting http://www.wowarmory.com/character-s...nflight&n=Ming
ErrorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: http://localhost:10001/widget/wowarm.../WowArmory.swf cannot load data from http://www.wowarmory.com/character-sheet.xml?r=Black%20Dragonflight&n=Ming."]
This is because the wowarmory.com server doesn't have crossdomain.xml file in the root. If you're using Firefox as a browser and you have Firebug installed (or Fiddler in IE or even Wireshark – possible overkill there) you'll see that the browser requests a crossdomain.xml file and doesn't find one.
http://blog.overlay.tv/2008/09/10/cr...tv-sdk-part-2/
This seems to be why it does not want to work, would explain a lot except for things working in Flash8 that is ...
-
Ryan Thomson
nope that's not the problem. The sandbox issue doesn't effect an swf when previewing from flash (or when saved as a projector). If you wanted to embed your armory feed swf in a browser and host it online then the problem would arise. This (and really all the problems people are having when using as2) can be easily solved by simply calling the needed armory data from a php file on your server which would just print the results. Then you just call that php file from flash rather than trying to talk with the armory directly.
-
-
Well i'm confused to weather we can actually pull and XML file still. I think that is the goal here seeing how it's in the XML area.
As far as AS3 i've been fiddling with my own version and i run into a problem of flash not wanting to send the user-agent header. When i publish it, it just says that it cannot access the server.
Code:
var xmlloader:URLLoader = new URLLoader();
var xml:XML;
function doneloading(e:Event):void
{
wowData_txt.text="hahah";
xml = new XML(e.target.data);
wowData_txt.text=xml.toString();
}
function init():void
{
// load the "slides.xml" file
trace("here");
xmlloader.addEventListener(Event.COMPLETE, doneloading);
// load the xml
var wowhead:URLRequestHeader=new URLRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2");
var rootURL:String = "http://www.wowarmory.com/character-sheet.xml?";
var charRealm:String = "Duskwood";
var charName:String = "doom";
var charSheetXML_URL:String = rootURL +"r="+ charRealm +"&n="+ charName;
trace(charSheetXML_URL);
var re:URLRequest = new URLRequest(charSheetXML_URL);
//re.method=URLRequestMethod.POST;
re.requestHeaders=new Array(wowhead);
wowData_txt.text="aaaaaaaa";
xmlloader.load(re);
wowData_txt.text="bbbbbbbbb";
}
init();
wowData_txt is a text box.
This is AS3 created in CS4.
i'm not sure what this will print out of the request ever actually went through however it gets stuck at xmlloader.load(re) and claims it cannot send user-agent headers.
I also changed the character because the one in the old examples is not active anymore.
-
"2096 The HTTP request header <[I]header_name[/I]> cannot be set via ActionScript"
Hello Guys,
I have been trying to do the same thing, and I noticed what the problem was after several attempts, yo may al ready know this but I think it may help some one.
The error:
"2096 The HTTP request header <header_name> cannot be set via ActionScript"
In this case "the User-Agent" is banned by Adobe.
They state that this is for security reasons.
This link shows you the statement from Adobe.
http://kb2.adobe.com/cps/403/kb403030.html
Info from Adobe
http://livedocs.adobe.com/flash/9.0/...imeErrors.html
If any one has an update on this further my information please let me know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|