Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Policy File...Totally Lost...



Well, I read and read about 45 pages of documentation on policy files, but...

I'm still confused as snot as to how to get flash to recognize a policy file.

Do I place the file just in the same directory as the server application? Or do I force the server to send the file to the flash application? Do I make th server wait to receive the <policy-file-request/> thing?

What do I do? ANd then also, how do I format the policy file? It seems they can explain a junkload of "this is what policy files do and this is their security" for like 100000 pages but they can never get around to just showing a darn simple example of how to blasted do it!!!

Needless to say it just left me confused with a muddled brain and a hurt pride that I could not figure it out.

And I read through posts already in this forum about it, and it seemed everyone who asked already had a basic understanding of it of which I don't.

Thanks in advance for any help on this.



FlashKit > Flash Help > Actionscript 3.0
Posted on: 11-15-2008, 06:57 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Im Lost A Little... No, I Lied. Im Totally Lost
Ok... I have been making flash movies for quite some time and never tried to learn actionscript or any of that mumbo jumbo.

Heres the deal; I need to learn how to make a site in flash. Basically what I need to learn to do is how to make pages link together, Do you just make different scenes, or what is the best way of taking that on? Then do you just link it with get_url ... I understand how to integrate actionscript but "NO" clue on what ones to use or anything. PLEASE HELP... Thanks a ton

Joel McLaughlin

Totally Lost
Howdy,

Not being a Flash guy in any way, shape or form, I just happen to get a flash file and get asked to make the content dynamic.

I've tried so many methods I'm not sure what all I did. The closest I got was a tutorial from kirupa.com, having to do with XML list. But it seems that XML has some type of limits on the amount of text inside the tag?

At anyrate, what I am trying to do is: (Using Flash 6 & ASP)

Flash screen is split into two, right side is a title list of news items pulled from our database, I can get this list in string format, xml format, any format via ASP (I don't know PHP either).

Left side of the flash screen would show the news item when the cooresponding title is clicked on the right side.

Can anybody point a flash newb into the right direction? An almost perfect one was from Bill Watson's website, except it seems to want some type of RSS format? I cannot understand the script enough to realize how to tweak it.

Thank you

Totally Lost
I feel like this code is almost done, it just has a few bugs in it which makes it not run properly.

It will give values sometimes, but it will go randomly to indefined values, and it normally ends in over half being undefined.

All of the variables are initialized properly at some point in the program, and the original length of the array is 40 numbers, so essentially 39...

I'm not sure if the problem is the Array.length or the Array.splice() or if it's something to do with the dynamic textfield. Any help would be greatly appreciated, and I look forward to finishing this project up









Attach Code

stop();
BgStr_mc.onLoad = function() {
var x = Stage.width/2;
var y = Stage.height/2;
var txt:TextField = this.createTextField("txt", this.getNextHighestDepth(), this._width/2, this._height/2, 200, 50);
rnd = Math.round(Math.random()*(block.length+1));
txt.text = block[rnd];
block.splice(rnd);
BgStr_mc._x = x;
BgStr_mc._y = y;
this.gotoAndPlay(7);
};
BgStr_mc.onRelease = function() {
gotoAndStop(7);
};

Totally Lost And Confused
I have never ever had such a hard time learning a program as I have Flash. Just when I think I understand a concept it doesn't work when I apply it.

Right now I'm trying to make a book that I have drawn slide from the left of the screen to the right of the screen. I accomplished that easily enough with a tween, which is the one thing that I seem to be able to do every time, though it took me a week to get it right. *sigh*

Alright, then I want the cover of the book to open. That's going to be difficult enough, however, when I try to edit the graphic it edits in all the frames prior to the one I edit in too! I DON'T WANT THAT!

I AM SO FRICKIN' FRUSTRATED! I just want to make something nice, something that my family can use to keep in touch and at the same time I want to advance my skills. I'm including the file so you all can see what I mean, then maybe someone can help me...

Frustrated by hopeful,
Rachel

GetBytesTotal - Totally Lost
I've got this preloader, but the movie keeps on playing when the bytes loaded are 33% instead of 100%. Now, I really don't have any clue why it could happen. If someone can see deeper than me, please tell me why!!


Code:
onClipEvent (load)
{tkb = _root.getBytesTotal(); }

onClipEvent (enterFrame)
{
p = Math.round((_root.getBytesLoaded()/tkb)*100);
_root.percent = p;
if (p == 100)
{play(); }
}
Thank you!

Totally Lost Tween -> Actionscripting
so, im lost here. i read that by using ationscripting rather than tweening, file size decreases dramatically. would someone be able to point me out to some sources on how to do this or where i can find information regarding this? im creating these huuuuge flash files and this stuff could help me out a lot.

thanks in advance,
Go Sugimoto
gsugimot@risd.edu

I Am Totally Lost I Want To Create A Banner
I am like your newest member and I am like totally lost I want to create a banner and all I want is some text doing some cool stuff and maybe a picture appearing and disappearing. nothing to complex. buy I I got done was the banner and I typed in the text I don't know what to do next can you give me some detailed help please an example of that I am talking about is the banner on http://www.flashbanger.com/freebees/freebees.html the banner that says Welcom to my homepage. I really appreciate whatever help you can give

Totally Lost It In MX... Tell Target Question
Since mx came out I totally lost it and have gotten dicouraged in a few ways(feel like a total noob again).... Mostly it's the actionscript stuff, now I finally picked it up again after a year and am starting to get used to most stuff(except this actionscript business ... How does it work to tell an instance what to do? Normally this was tell target but I figured that this is changed...

Totally Lost On Actionscripted Movement
Hi everyone,

I am trying to learn Actionscript. Right now my solution of choice is KoolMoves, however it shouldn't matter since I am trying to do everything in as.

My problem is that I might have an incorrect mindset when approaching scripting in Flash. I have done mainly C++ programming in OpenGL. In that environment I could write in a single .cpp file the commands to draw a circle on the screen, move it right 200 pixels in 10 steps and then stop. As I am trying to learn how to do this in actionscript I am getting utterly confused.

I seem to not be able to understand timelines or something. First I tried creating a movieclip that was a simple circle and attaching some actionscript to it's behavior. I wrote

Code:
onClipEvent(load) {
x_move = 5;
}
onClipEvent(enterFrame) {
_x += x_move;
}
Now this is able to animate the object and I only need to use one frame and create one instance of the object. The problem with this is that I can't seem to stop it, nor can I seem to write custom functions. If I start to write function blah() {} it gives me an error telling me it expects an onClipEvent.

Then I tried studying some of the tutorials on actionscript.org that were entitled ~"actionscripted motion" but their suggestions involved writing code not on the movieclip itself but on the frame. Not only that, but the code was divided up in like 3 frames and used gotoAndPlay functions. This doesn't make sense to me. Why can't I just program the movieclip itself to do what I want it to do which is how I intuitively want to code in? Why would I have to have a movie with multiple frames cycling through?

I thought I could learn actionscript in order to make things move around on the screen and have only a one frame movie. The perfect example of this is the example of motionscripts in KoolMoves. Here all I have to do is start the program, draw a circle and give it a motionscript of bounce, and it will bounce once on the screen. I didn't have to make additional frames or anything.

So is it possible to just write actionscript for an object to do something on the screen, like a tween, which is self-contained within the object or do I have to learn a whole new style of comprehending the Flash environment?

Thanks.

Focus (I Think) Question (totally Lost)
Hey everyone,

I was just asked to add a new piece of functionality to add this menu that I have designed:

http://www.whatadewitt.com/coolriot/menubar.html

As you can see, if you click the top bar the menu will expand and collapse. Good, great, awesome.

What I need to add is some AS code that will make it so that when a user clicks off of the .swf area, the thing will collapse... I think it's a matter of focus, but I am so lost... anyone have anything that may be able to help me out?

Note: This is just on my personal site right now, it is not totally functional on that, but you'll be able to get the idea of what I want without having everything working.


Thanks a ton, K-Crew!

--D

Aargg Totally Lost NEED SERIOS HELP
Last edited by fappy : 2002-05-16 at 07:57.
























No need to reply on this threat anymore... at the moment i wanted
to jump out of the window... came colorblind to the rescue...
THANKS!!! COLORBLIND


swf preloader still doens't works.... I've placed a empty MC (movieclip) called HOLDER and have a button to load in the external SWF.
This is the action i assigned to the button:
Code:
on (release) {
loadMovie ("external.swf", "_root.holder");
}
the external SWF is build with 2 scenes, in scene 1 is the preloader in scene 2 the
content. The preloader on scene 1 is build like this...
I've placed the following script in frame2

Code:
if (_root.holder.getBytesLoaded() >= _root.holder.getBytesTotal()) {
_root.holder.gotoAndPlay("loaded");
}
percentLoaded = Math.round((_root.holder.getBytesLoaded()/_root.holder.getBytesTotal())*100);
loadingText = "Loading content..." + percentLoaded + "%";
and placed a textfield called "loadingText"

on frame 3 is the following script.

Code:
_root.holder.gotoAndPlay("check");
i've als tried it without referring to the MC called HOLDER in the script above

help!!! Source file: www.fappy.nl/test/index.htm You'lle need open the mainmovie_mc.fla and external file

Totally Lost. Optimizing Jpegs In Photoshop. HELP
I'm making a photography website. I have a bunch of jpegs that are big with memory.

I'm trying to optimize them so that they are reasonably small in memory so they can download.

After looking at other similar sites, I figured that I want to try to keep them around 25k.

But I can't seem to do it. I'm lost. I cut the resolution to 72, and lower the pixel dimensions pretty low, and then I save for the web and save it as a gif, but it is still big.

Any advice?

here is the confusing part. I went to some photo site, and took a look at some of their images, from my temporary internet files folder.

I looked at one jpeg, looked under properties and saw that it was 15.7kb. So then I copy it to my desktop, and open it in photoshop.

In photoshop, I go to image size, and it says 1 mb. So, I'm thinking, how does this one megabyte jpeg come off as a 15kb image? But sure enough, when you click on properties, it says it's 15kb, and when you open the very same image in photoshop, it says 1mb.

HELPPPPPPPPP. I don't know what's going on here. It seems that I don't know something here...some trick, or some strategy to optimize these images so that I will have good quality and low file size. Others are doing it on the internet, but I'm having trouble duplicating it.

Can you help me?

Thanks.

Totally Lost. Optimizing Jpegs In Photoshop. HELP
I'm making a photography website. I have a bunch of jpegs that are big with memory.

I'm trying to optimize them so that they are reasonably small in memory so they can download.

After looking at other similar sites, I figured that I want to try to keep them around 25k.

But I can't seem to do it. I'm lost. I cut the resolution to 72, and lower the pixel dimensions pretty low, and then I save for the web and save it as a gif, but it is still big.

Any advice?

here is the confusing part. I went to some photo site, and took a look at some of their images, from my temporary internet files folder.

I looked at one jpeg, looked under properties and saw that it was 15.7kb. So then I copy it to my desktop, and open it in photoshop.

In photoshop, I go to image size, and it says 1 mb. So, I'm thinking, how does this one megabyte jpeg come off as a 15kb image? But sure enough, when you click on properties, it says it's 15kb, and when you open the very same image in photoshop, it says 1mb.

HELPPPPPPPPP. I don't know what's going on here. It seems that I don't know something here...some trick, or some strategy to optimize these images so that I will have good quality and low file size. Others are doing it on the internet, but I'm having trouble duplicating it.

Can you help me?

Thanks.

Totally Lost Form Mail And Perl Script Headaches
Could someone take a look at my files please. I have spent the last week trying to get this #@!$ thing to work. I am attaching my fla
and the perl mail scripts are below. When I test the output of the sendVars object, the variable values are correct. If I execute the sendMail script on the server, it opens a window showing successful execution. But when I try the site, I get nothing.

I am so lost and almost bald from ripping my hair out.

thanks,

chosenson





********************scripts**start**************** ********************

#!/cgi-bin/CGI.pm

require "subparseform.lib";
&Parse_Form;

$Email = $formdata{'userm'};
$FirstName = $formdata{'usern'};
$Subject = $formdata{'subj'};
$ToComments = $formdata{'bod'};
$HearAbout = $formdata{'HearAbout'};

$ToEmail = "chosenson@excite.com";
$ToSubject = "Study Buddy User Mail";

$EmailBody = "Sent By: $FirstName
Senders Email: $Email
Senders Subject: $Subject


Message Sent:
$ToComments

Sender Heard About Site From: $HearAbout
";

$EmailFooter = "
This message was sent by: $FirstName. This message needs immediate attention!";

$Message = $EmailBody.$EmailFooter;

open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
print MAIL "To: $ToEmail
From: $Email
";
print MAIL "Subject: $ToSubject
";
print MAIL "$Message
";
close (MAIL);

print "Content-type: text/html

";
print "_root.Mail.EmailStatus=Complete - Your mail has been sent";

sub ErrorMessage {
print "Content-type: text/html

";
print "_root.Mail.EmailStatus=Connection Failed Please Check the path to the Mail program";
exit; }



*******************subparse.lib*********starts*her e*******************


sub Parse_Form {
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);

if ($ENV{'QUERY_STRING'}) {
@getpairs =split(/&/, $ENV{'QUERY_STRING'});
push(@pairs,@getpairs);
}
} else {
print "Content-type: text/html

";
print "<P>Use Post or Get";
}

foreach $pair (@pairs) {
($key, $value) = split (/=/, $pair);
$key =~ tr/+/ /;
$key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$value =~s/<!--(.|
)*-->//g;

if ($formdata{$key}) {
$formdata{$key} .= ", $value";
} else {
$formdata{$key} = $value;
}
}
}
1;

Loading External Swfs - Totally Lost As To Where To Put Coding In My Script
It sounds so simple until I try to figure out what coding goes where: How to add an additional function to 3 buttons. So far, the buttons perform 3 functions: they move themselves on and off a set of x-y coordinates, add/remove a score from a score box, and play a sound clip.

Now, I want to have each button bring in an external animated swf file and play it inside of an empty movie clip with an instance name of "container." Just to cover all bases, I also gave it a linkage name of "Container." I have scoured the internet for info on how to do this but it just gets me more confused. I just need to know what the coding would be and in what order it would fit into my coding.

If any of you who read this can help me, I'd be so grateful! Here is what I have so far:

package
{
import flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.MouseEvent;
import flash.media.Sound;
import flash.media.SoundChannel;

public class Breakfast extends MovieClip
{
private var pancakes1:Pancakes;
private var waffles1:Waffles;
private var cereal1:Cereal;

private var offPlatePancakes:Boolean;
private var offPlateWaffles:Boolean;
private var offPlateCereal:Boolean;
private var calories:int = 0;

//create and manage food
public function Breakfast()
{
//create food
createBreakfast();
}

// set up sounds
var theAddCereal3:AddCereal3 = new AddCereal3();
var theAddFruit3:AddFruit3 = new AddFruit3();
var theAddVeggies3:AddVeggies3 = new AddVeggies3();

private function createBreakfast():void
{
//create a textfield to store the calories
var calorieField:TextField = new TextField();
var tf:TextFormat = new TextFormat();
calorieField.x = 420;
calorieField.y = 530;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
addChild(calorieField);

//add pancakes to stage and turn into button
var pancakes1:Pancakes = new Pancakes();
//var myMCL:MovieClipLoader = new MovieClipLoader();
this.addChild(pancakes1);
pancakes1.x = 11;
pancakes1.y = 42;
offPlatePancakes = true;
pancakes1.buttonMode = true;
pancakes1.addEventListener(MouseEvent.CLICK, managePancakes);
//myMCL.loadClip("bearWaffle.swf", "container");

//add waffles to stage and turn into button
var waffles1:Waffles = new Waffles();
this.addChild(waffles1);
waffles1.x = 111;
waffles1.y = 40;
offPlateWaffles = true;
waffles1.buttonMode = true;
waffles1.addEventListener(MouseEvent.CLICK, manageWaffles);

//add cereal to stage and turn into button
var cereal1:Cereal = new Cereal();
this.addChild(cereal1);
cereal1.x = 101;
cereal1.y = 111;
offPlateCereal = true;
cereal1.buttonMode = true;
cereal1.addEventListener(MouseEvent.CLICK, manageCereal);

function managePancakes(event:MouseEvent):void
{
if(offPlatePancakes)
{
pancakes1.x = 119;
pancakes1.y = 380;
calories = calories + 50;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
offPlatePancakes = !offPlatePancakes;
playSound(theAddCereal3);
}
else
{
pancakes1.x = 11;
pancakes1.y = 42;
calories = calories - 50;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
offPlatePancakes = !offPlatePancakes;
}
}

function manageWaffles(event:MouseEvent):void
{
if(offPlateWaffles)
{
waffles1.x = 129;
waffles1.y = 382;
calories = calories + 50;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
offPlateWaffles = !offPlateWaffles;
playSound(theAddFruit3);
}
else
{
waffles1.x = 111;
waffles1.y = 40;
calories = calories - 50;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
offPlateWaffles = !offPlateWaffles;
}
}

function manageCereal(event:MouseEvent):void
{
if(offPlateCereal)
{
cereal1.x = 117;
cereal1.y = 377;
calories = calories + 30;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
offPlateCereal = !offPlateCereal;
playSound(theAddVeggies3);
}
else
{
cereal1.x = 101;
cereal1.y = 111;
calories = calories - 30;
calorieField.text = " " + String(calories);
tf.font = "Arial";
tf.align = "right";
tf.bold = true;
tf.color = 0x000000;
tf.size = 32;
calorieField.setTextFormat(tf);
offPlateCereal = !offPlateCereal;
}
}
}

public function playSound(soundObject:Object)
{
var channel:SoundChannel = soundObject.play();
}
}
}

Totally Lost - How To Develop Buttons And Lists To Interact With A Database?
[using flash 8 pro]
I am so out of my league here it isn't even funny.

I need to develop interface components, similar to the list and combo box components, that will allow the user to choose from around 25 search criteria and then click a "GO" button to send their search request to a database. Some input text fields will be needed as well.

I am writing this because my experiments with the components in Flash 8 pro have revealed they stop working if any movement is applied to them. I need to use them in a movie clip that moves around. To help explain, I have attached the entire thing here. Run the swf, click on the big "Search" button and you'll see what I'm talking about. The list component there should have two rows of text visible: "blah1" and "blah2". There is no text.
GET THE FILE
All I need help on is:
-Should I use components to do this? I'll need lists, comboboxes, and text entry fields.
-Should I custom make the UI things I need?
-Is this even the right way to design such things that interact with a database?

Xml Policy File?
I've set up an xml policy file, and it's working nicely. However, if the request is coming from an invalid domain or IP, how can I display some sort of error? (popup or something...)

How can I check for an invalid domain? There must be something within flash that tells me. Any ideas?

9.0.124 Policy File Changes AHH
Ok so I just confirmed that installing the latest flash player 9.0.124 causes my webservice connection to fail.

It seems to be because of the new policy restrictions listed here:

http://www.adobe.com/devnet/flashpla...ty_update.html

and Here:

http://www.adobe.com/devnet/flashpla..._security.html

It's written in such a convoluted manner that i don't understand what changes i need to make.

Anyone know what files you need to make webservices work and have an example?

Much Thanks!

Policy File's In As3
Hi, I have been looking for a while on how to make a policy file for the new flash update and I can't seem to get it to work. I hear you need to make a master policy socket file on port 842 but I don't see any examples on how to do this anywhere. I am running a java server and sending info through a socket to the flash player. If someone could kindly show me how to make this work I will be really appreciated.

Thanks for your time,

Shawn Janas

Policy File Nightmare...
Can anyone help pleeease?

I'm building a site that works w/ bitmap data and everything's great, works perfectly when I access it from www.mysite.com but, of course, the bitmap data won't draw when I access it from simply mysite.com

At the top of my document class I have:

Code:
Security.loadPolicyFile("http://mysite.com/crossdomain.xml");
Security.loadPolicyFile("http://www.mysite.com/crossdomain.xml");
Then on the loader I have:

Code:
var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;
var urlReq:URLRequest = new URLRequest("images/someImage.jpg");
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,this.loadCompleted,false,0,true);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,this.updateLoadBar,false,0,true);
loader.load(urlReq,context);
At mysite.com/ I have a policy file called crossdomain.xml that looks like:

Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="http://www.mysite.com" />
<allow-access-from domain="http://mysite.com" />
</cross-domain-policy>
I can't figure out what else I should have to do, but this doesn't work...what am I missing?

Socket Policy File
HI,
Apologies if this is not the correct forum to post to.

I've got an app that connects to a java servlet on port 17000, the crossdomian file is placedon the web server root. Everything was working fine.

After the recent security changes to the flash player, the swf fails to connect to that java servlet. I'm assuming I need to serve the crossdomain file on port 843 or on port 17000 is this correct?

If so, any help will be appreciated.

Thanks,
Sherif

[CS3] [AS2] Can Anyone Help With Socket Policy File?
I've got a FP9 AS2 document, that is using a webservice.

It suddenly stopped working on the new FP 9.0.124.0 cause of the security updates, but I have no clue how to get the socket policy file set up properly.

The webservice is hosting Port 80 right now.

I've looked at all of the technical documentation about the security update, but nothing is easy, and this is way beyond what I know about IIS, and Web Services...

Ktu

Crossdomain Policy File
Hey everybody,
I am having troubles with a simple LoadVars(). When I am loading the txt file from my local environment, I have no troubles. When the file resides on a different server though, the headache starts. None of the data resolves. When monitoring the activities, I cannot see flash making the call to my text file.
So I was thinking that it must be the crossdomain file:


HTML Code:
<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.*"/>
</cross-domain-policy>
Nothing wrong with that one as far as I can tell. Essentially I have a banner that will be accessing a txt file of a central server (this the domain="*.*"). Anyone know where I should start looking as to why nothing seems to load? I moved the file onto a different server and all works well. What could this be?


thanks

V.

How Would I Make A Policy File?
I'm trying to put a client on my domain www._mydomain_.net that can communicate with my computer that I'm typing into right now on port 9000, by my IP address. I know SecurityError: Error #2010 means I need to make a policy file.

How would I make this policy file? I am running a very simple flash server I just made, and I just want my flash to connect. How would I go about making this policy file? This is very important, I want to move on to greater things once I figure this out.

Sorry for being ignorant, but I need help!

Help With Policy-file-request?
hi all, i have just created a flash chat program, which is powered by xml and socket(on the same computer), the program is working fine when i double click on the swf file, but when i put it up on my localhost server(same computer as where the socket is run on), the program doesn't seems to work..
please help me.

thank you!

Policy File Question
Here's my setup:

policy server on port 843

The policy server sends the following:

<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false" />
</cross-domain-policy>

my swf is served from a different domain, non-ssl:
www.no-ssl.com

inside my SWF, I'm trying to load a string UNDER SSL from a different
domain:
_root.loadVariables("https://"+ Host +"/keygen/key.xio");

It looks like it's hanging on the above... any suggestions? I thought
sercure="false" was supposed to allow a non-ssl SWF to
connect to an SSL site?

Thank you

Socket Policy File
hello,
I ahve written a java socket server to connect my flash clients to. I have my java server send my policy file:
<cross-domain-policy><allow-access-from domain='*' to-ports='6666' /></cross-domain-policy>

whenever it gets a <policy-file-request /> . However when i upload my flash client to a website and point the IP adress and port to my server I get a security sandbox violation error:

Error #2048: Security sandbox violation: http://rainer.joolo.com/DrawBoard.swf cannot load data from 98.199.***.***:6666.

The strange thing is that it worked a week ago, and suddenly it stopped working. In the last week my ip has changed, and i had to reinstall flash player. I dont see why installing the latest flash player should give me the error.
If anyone knows why this could be a problem, please help.

Necesity Of Policy File?
Do i always need a policy file to load external images?
In Flash IDE all is fine, but after checking in browser images won't resize... (ooops I haven't tried SecurityErrorEvent listener... oh, I did! try..catch has thrown Security Error).
ActionScript Code:
private function _thumbComplete(event:Event):void {  try {   event.target.removeEventListener(Event.COMPLETE,_thumbComplete);   event.target.removeEventListener(IOErrorEvent.IO_ERROR,_thumbIOErrorHandler);   event.target.content.smoothing=event.target.loader.tabEnabled=true;   event.target.content.width=event.target.content.height=100;   ...}
My question is: Do I need a policy file to access smoothing, width or height of image? This is riddiculus, help tells only about BitmapData.draw().
I tried to comment that smoothing and still same problem.
This would be horrible to put there a policy file... since i need a forgotten password...
Is there a possibility to ommit using that policy file?

A Policy File Is Required
Can someone help me out with this error?
I'm accessing images form the same domain.

Code:

SecurityError: Error #2122: Security sandbox violation: Loader.content: http://www.missionofcompassion.org/beta_web/flash/cube/cube.swf cannot access http://missionofcompassion.org/beta_web/images2/logoNotrans.png. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
   at flash.display::Loader/get content()
   at org.papervision3d.materials::BitmapFileMaterial/loadBitmapCompleteHandler()[C:Documents and SettingsAdministratorDesktopFlashActionscriptorgpapervision3dmaterialsBitmapFileMaterial.as:286]

Movie File Looks Totally Different
Hello!  I am having a problem.  When I import a .SWF flash movie back into flash, sometimes the movie will look different.  Lines are different thickness, color properties disappear -- it's all weird.

To visually explain it better I've uploaded a explanation with the problem flash files here: http://home.pacbell.net/trevor-x/bunny.htm

I would like to know why this happens, and how I can get around it, because it's getting pretty annoying!

Thanks a ton, and sorry for the lack of preloaders on those swf's...

-Trevor!

[F8] <policy-file-request/> Showing Up
I have a small chat application (using sockets) and everything worked fine, until a friend of mine tried it out and I got this strange thing happenning.
Once it connected it sent a '<policy-file-request/>' message. This seems to me as an AS3 feature. I've my application using both IE7 and an updating version of FF. I'm not sure how he was able to create this problem and I cannot.
Has anyone seen this before? Do I now have to have the server send some xml styled policy file to allow this socket to connect? If so, why?
Thanks in advance.

Socket <policy-file-request/>
I see now that Flash 9 requires a policy file to open a socket connection. I can't find any good material on how to setup this policy file. I don't really want to have to create a seperate server (Java) on port 843 and I've read that you can set one up on the socketing-requesting port (6000 in my case). One site I read (http://www.lightsphere.com/dev/artic...et_policy.html) says to simply reply with the following text:
"<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>"
I do get the String request "<policy-file-request/>" from the flash client but when I sent that <cross-domain-policy....reply it did nothing. The socket just sits there waiting.
There other strange thing is that this seems to be a problem with Firefox only. I tried it with IE7 and it makes the request but then keeps on sending/recieving data...even without the policy file reply.
Anyone know more on this topic and how I can get the FF version to work?
Thanks in advance.

What Is The Most Permissive Crossdomain.xml Policy File?
What need I do to allow a SWF to access my web service? I have a web service here:

https://data.expensify.com

I've configured it to respond with the absolute maximally-permissive crossdomain.xml:

https://data.expensify.com/crossdomain.xml

HTTP/1.1 200 OK
Content-Type: text/x-cross-domain-policy
X-Permitted-Cross-Domain-Policies: all
Content-Length: 299

<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="all"/>
</cross-domain-policy>

I have a SWF I'm hosting on http://127.0.0.1/Expensify.swf. I've configured my mm.cfg to enable policy-file logging, and it logs:

OK: Root-level SWF loaded: http://127.0.0.1/Expensify.swf
OK: Policy file accepted: https://data.expensify.com/crossdomain.xml
Error: Request for resource at https://data.expensify.com/xxxxxxxxx by requestor from http://127.0.0.1/Expensify.swf is denied due to lack of policy file permissions.

Any clues what I need to do? Must I host it on https://127.0.0.1?

Basically, how can I configure data.expensify.com to say "really, seriously, *ANYBODY* from *ANYWHERE* at *ANY TIME* can call me. *REALLY*."

Thanks!

-david

Sandbox Error / Policy File
Hi,

I've been wracking my brain with this policy file business and I don't seem to be getting anywhere...and so, I'm asking for some help.

I'm using binary sockets in my Flex app and I'm trying to get this working from my domain. From what I've read, I need to have a small program running on my server whose sole purpose is to accept a connection from Flash player (from the Security.loadPolicyFile call), and regurgitate an XML policy file with a null byte at the end.

However, the Flex app throws the sandbox error, but does not seem to have ever attempted a connection to my policy file program (which is listening on port 843). Do I need to explicitly tell the loadPolicyFile call to look at port 843?

Here's my code snippet...


ActionScript Code:
var myConnection:Socket;
       
Security.loadPolicyFile("http://xxx.xxxxxx.com/crossdomain.xml");
       
private function submit():void {
           
           
   myConnection = new Socket();
           
   // add event listener to listen for when data arrives from server
   myConnection.addEventListener(ProgressEvent.SOCKET_DATA, onSocketData);
           
   // add event listener to for data send/receive errors
   myConnection.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
           
   // connect to server
           
   myConnection.connect("http://xxx.xxxxxx.com/hello.htm", 7000);

   myConnection.writeUTFBytes(textinp.text);

   myConnection.flush();
           
}

So I guess my main question is...should the Flash player have made a connection attempt (I'd imagine so)? Am I doing something wrong conceptually? My crossdomain.xml file is about as liberal as it comes...I have the domain and port attributes both set to '*'.

Thanks for any and all help!

Mitch

Policy-file-request Problem
I am at my wits end trying to sort out a problem. Any help is deeply appreciated.

According to http://www.adobe.com/devnet/flashpla...ity_print.html


Quote:




* A SWF file may no longer make a socket connection to its own domain without a socket policy file. Prior to version 9,0,115,0, a SWF file was permitted to make socket connections to ports 1024 or greater in its own domain without a policy file.
* HTTP policy files may no longer be used to authorize socket connections. Prior to version 9,0,115,0, an HTTP policy file, served from the master location of /crossdomain.xml on port 80, could be used to authorize a socket connection to any port 1024 or greater on the same host.




So with the tighter security measures, a policy file has to be fetched on port 843 or on the same port on which a connection is desired. That leads to another problem. The policy file request made by the player has a simple format: clear text <policy-file-request/> is sent as raw data bytes on the ports.

As most firewalls (specially application firewalls) block such raw data traffic (of unknown protocols) on all the ports, this means that the policy file fetch will almost always fail if the user is behind any firewall.

This will render all SWFs, that do not use ports 80/443/25, unusable. Does anyone know what is the solution to this problem? Or am I missing something here?

Loading Large Policy File
Hi!
I have an issue about Flash's security model and specifically the cross-domain policy file (xml). It's quite easy to use in normal cases, but say I have an application distributed to a thousand web sites. The application should read data from my server. In this case I need a policy file containing 1000 domains. That would be a fairly large file to load and could result in an unacceptable delay in the application. Also, the application loads way more data than needed. It would only need a policy file containing one domain - the one where the application is situated.

I was thinking of creating a separate policy file for each domain that holds the application.

Instead of a policy file like this:
• policyfile.xml
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="www.somedomain.se" />
<allow-access-from domain="www.someother.com" />
<allow-access-from domain="www.thirdsite.dk" />
...
</cross-domain-policy>
...and so on for a thousand domains, I could have individual files like this:

• policyfile_www.somedomain.se.xml
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="www.somedomain.se" />
</cross-domain-policy>

• policyfile_www.someother.com.xml
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="www.someother.com" />
</cross-domain-policy>

• policyfile_www.thirdsite.dk.xml
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="www.thirdsite.dk" />
</cross-domain-policy>

The application knows which domain it resides on, therefore it's easy to build the path to its individual policy file. The individual policy file is small and loads in no time.

An alternative is to set up a database with info about all my distributed applications. The application's loadPolicyFile calls a server script that returns xml with individual policy data. Small and fast.

Does anybody have some other nice solutions or would like to share your experiences on this?

Thanks
/uamg

Specifying Cross Domain Policy File?
I'm trying to get the Yahoo weather working, but I'm running into a crossdomain problem. The path to the crossdomain file one of the Yahoo guy's gave me is:

http://weather.yahooapis.com/crossdomain.xml

And the weather information is being pulled from:

http://xml.weather.yahoo.com/forecastrss?p=24502

How do you specify where the crossdomain policy is located?? I looked in the forums but all I could find is that AS looks in the same domain...which would mean its looking in http://xml.weather.yahoo.com which is the error its giving me (Failed to load policy file from http://xml.weather.yahoo.com/crossdomain.xml)? Any ideas??? Thanks...

Socket Policy File Not Working?
Hey guys,
For my work, we use a flash XMLSocket to connect to one of our daemons and then exchange data.

Nothing to worry about here, i even got it working. But, i updated flash on my XP Installation.
And it stopped working. Kind of worried, i searched, and found.

The flash 9.0.115 enforces strict policy rules, which blocked my 'local domain just connect' usage.

I tried to use this XML File:
quote:<cross-domain-policy>
<allow-access-from domain="beta.firmfootball.com" to-ports="8421"/>
</cross-domain-policy>

My logs seemed to be oké.
quote:OK: Root-level SWF loaded: http://beta.firmfootball.com/design...monService.swf?
OK: Policy file accepted: xmlsocket://beta.firmfootball.com:843
OK: Request for resource at xmlsocket://beta.firmfootball.com:8421 by requestor from http://beta.firmfootball.com/design...monService.swf? is permitted due to policy file at xmlsocket://beta.firmfootball.com:843
OK: Root-level SWF loaded: http://beta.firmfootball.com/design.../swf/postit.swf
OK: Root-level SWF loaded: http://beta.firmfootball.com/design.../swf/idcard.swf
OK: Root-level SWF loaded: http://beta.firmfootball.com/design...monService.swf?
OK: Policy file accepted: xmlsocket://beta.firmfootball.com:843

But, when i tried to connect using my flash object, i got nothing. I tried my debugging options, telling me that it did not connect to the service.

I'm wondering what my mistake was.

Additional information:
Website:
-www.firmfootball.com
Master policy file:
-beta.firmfootball.com:843
Service
-beta.firmfootball.com:8421

Thanks in advance,
Josko de Boer.

Policy File Changes In Flash Player 9
I have a form that sends mail (smtp) through a socket connection (actionscript), which I picked up here, http://www.bytearray.org/?p=27
Tested and works fine locally, but when posted online and tested, it quietly fails.

I am trying to send mail from my domain, to the mail function within my host server. (same domain).
Tried both "local" and "network" publishing options.

I have read the article on socket security at http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html
but I do not have the option to place a crossdomain.xml file at port 843 since I am on a shared server.


I've read everything that I can online but because policy changes from player 9,0,115,0 on, it seems that older posts may not be relevant, so is there another way to approach this matter?
Is it possible for me to hard code the cross domain policy into my scripts or .fla?

Thanks,
Key.





























Edited: 05/27/2008 at 08:34:42 AM by KEY_NYC

<policy File Request /> Problem In IE
Hello all,

I have made a chat application written in AS2.i have a seprate java server for my application.
i m using XMLScoket object to connect flash client to java server.

var clientSocket:XMLSocket = new XMLSocket();
System.security.loadPolicyFile("xmlsocket://mysite.com:80");
clientSocket.connect("mysite.com",8080 )

My problem is that when i try to connect to java server, i get the "<policy-file-request/>" from the flash client and socket just sits there waiting.
strange thing is that this seems to be a problem with flash player 9 in IE only.it workes perfectly fine with mozilla,netscape,safari and opera.The crossdomain file is inside root folder of tomcat.Both flash client and java server are in same domain.
If we comment code for loadpolicyfile in AS2 then still problem is same

please help me on this issue
thanks in advance

Policy-file-request, Problem
I have a small embedded device that is a web server. I have created a FLASH app that makes a socket connected back to this web server on port 10000 to exchange data.
Now that this new policy-file-request is implemented all my apps don't work.
Most of the threads I read about this talk about what to post on the sever to allow it to connect.
what I need to know is that when the user goes to my deices web page the FLASH app send back <policy-file-request/> to my sever. Since I do not know what exactly to send back to it the app closes.
What do I need to reply back with for this to be ok ?

Flash Policy File/scokets
Hello,
Ive developed a socket java server along with flash client chat. Everything works fine on my local host and with some of my friends but in some cases the connection cannot be established. For example when a friend of mine tried accessing the chat, he connected and immediatelly disconnected. Im not sure but I think it has something to do with the policy file which I dont think I set up properly. Does anyone know what may be the reason for the strange disconnections?

thanks

EDIT:

you can see my chat at: belox.gotdns.com:8000/chatClient.html

Vista Gadget Policy File Bug
We have developed a gadget application for Microsoft Vista one year ago,
gadget includes a swf file which loads data from our webserver,
so when client uses the gadget,
the address of swf is,
"file:///C:/Users/username/AppData/Lo...adgetSmall.swf"
so in regular,
if we don't prepare a policy file that gives permission from any swf that comes from any domain, the swf (so gadget) cannot load the data from our webserver,
in our tests that we made one year ago, we couldn't load data without using a policy file,
but one year later,
2 days before ,
when I was working I realized that policy file in the web server have been deleted 5 months ago (from iis log files, swf takes 404 when thet try to load policy file for 5 months),
I expect that gadgets should not work
but they are still working,
but how?
there is no policy file in our web server,
but the client swf,
which is in users' gadget file is able to load data from our servers,
In addition, the swf file that isused in gadget application doesnt work in a stand-alone application ( for example in a separate internet explorer, I got the following error in flash player logs

Warning: Failed to load policy file from http://xxx.xxx.xxx/crossdomain.xml
Error: Request for resource at http://xxx.xxx.xxxx/xxx/xxx.aspx by requestor from file:///C:/Users/xxx/AppData/Local/M...adgetSmall.swf is denied due to lack of policy file permissions.
)

I searched a lot, but I couldn't find anything,
yes there is no problem for me,
gadgets are working,
but only I'd like to learn, what have been changed, any comments will be appriciated..

Xmlsocket And Policy-file-request
I have a chat server written in Java listening on port 6000 and a client app(using an xmlsocket) in Flash 9. I get these <policy-file-request/>. I understand the purpose and I read the one solution about creating a server on port 843 and serving a master policy file but since I do not have total control over our hosting I cannot use port 843.
I also tried replying to the request with "<cross-domain-policy><allow-access-from domain='*' to-ports='*'/></cross-domain-policy>" + "" but nothing happens.
The other really strange thing is that using Firefox the file request waits for the response and does nothing...but in IE7 the file request goes through then it continues to work even with no response, I can send/receive using the socket without problem.
Does anyone know a good way to 'satisfy' the file request using the Java server listening on port 6000?
Big thanks in advance.

Policy File Request Problem
Hello

I've created a socket server running on a dedicated windows server. From the Flash IDE, or from swf converted to exe, (both these prevent security checks) I can connect to it fine with no problems.

When I upload the swf to a website and access it through a browser I can't connect. I google the problem and apparently flash sends a "policy file request" to my server at port 843. So I open port 843 and create a new server for this port and I receive "<policy-file-request/>" and a NULL byte after that. When I receive that I send back a policy file string that looks like this:


Code:
<?xml version="1.0" encoding="UTF-8"?><cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd"><allow-access-from domain="*" secure="false"/></cross-domain-policy>
With a NULL byte after that string.

I removed indentation and newlines in case that was what was causing the problem. Both gave the same result though.

Now, according to the output from both my server (running on port 31414) and my port 843 server (the server to handle the request) my flash file connects to both of these, port 843 server sends the policy file, then flash file disconnects from both of these server. I read that flash connects and then disconnects after receiving the policy file but my file never tries to reconnect.

And the strange thing is, my flash file never receives a connection event. So it apparently connects to both servers, and disconnects, but never receives a connect event.

I think you understand what I want so if anyone could shed some light on this it would be greatly appreciated.

Printing A Totally External File
What I would like to have a button in a movie that would print an external file, such as a .doc or a .txt.

Please note this external file would at no time ever be part of the movie, not loaded into the movie in anyway.

I am not looking to print a frame of the movie.

I am not looking to load text into the movie then print it.

The external file would have nothing to do with the movie, it is completely seporate in every way.

- sorry, if this comes off as if I were speaking down to you, I just really wish to be clear.

Cross Domain Access / Policy File
I am trying to pull data in Flash from an xml file located on a seperate domain. When I test the flash movie in the Flash IDE I get my results fine, when I call the published html file from hard disk I get my results fine. But when I try to call the published html file through http it doesn't work. I understand the whole cross domain issue, in fact i placed the crossdomain.xml file in the same location as the published html and swf files and it doesn't work: Here is my source code!!!!!!!

CROSSDOMAIN FILE
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" /> <!-- denotes give all access, not practical but temporary to see if it would work -->
</cross-domain-policy>

FLASH
System.security.allowDomain("http://www.mydomain.com")

var oxml:XML = new XML();
oxml.ignoreWhite = true;
oxml.onLoad = function(success:Boolean) {
stat.text = success;
txt.text = oxml.firstChild;
};
oxml.load("http://www.mydomain.com/autocomplete/autocomplete.aspx?char=dog");

At this point I'm starting to think this is a setting in the browser rather then flash. I just dont' know, can someone PLEASE help!

Policy File Loads EXTREMELY SLOW
i can't figure this out.... i'm using this code in my application:


ActionScript Code:
Security.loadPolicyFile("xmlsocket://host:843");
            trace("policy file loaded.");
           
            this.socket = new XMLSocket();
//socket event listeners go here
           
            this.socket.connect("host", 10000);
            trace("conecting to port 10000...");

and I'm getting this log:
"OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at xmlsocket://host:10000 by requestor from http://mywebsite..."

And after like 5-10 min (but sometimes never) it *finally* connects and i get this log:
"OK: Policy file accepted: xmlsocket://host:843"
"OK: Request for resource at xmlsocket://host:10000 by requestor from http://mywebsite... is permitted due to policy file at xmlsocket://host:843"


Is there a way to dfind out why it takes soooo long or why sometimes it doesnt connect at all..

Policy File Request When Opening Socket
hi all
this is my first post and i hope i get answer
i am using a swf file to open socket to some url in a web application, sometimes it connect to the server listening socket then i send my data and get response, but sometimes i am getting nothing and still waiting without response, i used socketsniffer and found that i am getting

<policy-file-request/>
cross-domain-policy><allow-access-from domain="*" to-ports="9000" /><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>...

i read a lot about security policy files, but i do not how to use it.
thanks in advance .

Copyright © 2005-08 www.BigResource.com, All rights reserved