[Flashcoders] Security sandbox error during Upload/Download

2010-02-27 Thread ktt
Hello,

I created file Upload/Download function with FileReference, but on different 
computer I get errors:

Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox 
violation: http://mydomain.net/myboard/board-1.swf cannot load data from 
http://www.mydomain.net/myboard/uploads/some.jpg.
at myboardFunctions::downloadKlase$cinit()
at 
global$init()[/Users/demo/Desktop/board-new2010/myboardFunctions/downloadKlase.as:29]
at 
myboardFunctions::formserts/downloadHandler()[/Users/demo/Desktop/Whiteboard-new2010.02.14/myboardFunctions/formserts.as:444]

How to solve this?
Should I need to tune Flash Player 10 settings?

Thank you in advance,
Kioshin


  
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Link Around a Bitmap

2010-02-27 Thread Susan Day
On Fri, Feb 26, 2010 at 3:25 PM, Nathan Mynarcik nat...@mynarcik.comwrote:

 Put your bitmap in a movieclip and add a listener to the Md so when the
 user clicks it navigates to the new page.


Thanks!
Susan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Preloader, Pt. 2

2010-02-27 Thread Victor Subervi
Hi;
I had another idea on how to tackle this problem of wanting to load two
different swfs at the same time. (Please read thread if you don't understand
what I mean.) Then I want to call/load an URL. I get no errors, however, it
doesn't surf to the desired page, either. (Yes, I've loaded it on the
server.) Here's the complete code:

package
{
import flash.display.Bitmap;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.Loader;
import flash.events.ProgressEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.net.URLRequest;
 public class Preloader extends MovieClip
{
var loader:Loader = new Loader();
var loader2:Loader = new Loader();
var loader3:Loader = new Loader();
private var myTextField:TextField = new TextField();
var imgFlag1:Boolean = new Boolean(false);
var imgFlag2:Boolean = new Boolean(false);

public function Preloader()
{
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
 private function init(e:Event)
{
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
// loader.load(new URLRequest(images/logo.png));
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded2);
// loader.load(new URLRequest(images/map.png));
loader2.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
removeEventListener(Event.ADDED_TO_STAGE, init);
addChild(myTextField);
myTextField.width = 250;
myTextField.x = stage.stageWidth/2 - 50;
myTextField.y = stage.stageHeight/2;
myTextField.selectable = false;
myTextField.border = false;
myTextField.borderColor = 0xAA;
myTextField.autoSize = TextFieldAutoSize.LEFT;
var myFormat:TextFormat = new TextFormat();
myFormat.color = 0xAA;
myFormat.size = 24;
myFormat.italic = true;
//myTextField.setTextFormat(myFormat);
myTextField.defaultTextFormat = myFormat;
}

private function imageLoaded(event:Event):void
{
var image:Bitmap = new Bitmap(event.target.content.bitmapData);
addChild(image);
imgFlag1 = true;
if (imgFlag2 == true)
{
completePreloader();
}
}
 private function imageLoaded2(event:Event):void
{
var image:Bitmap = new Bitmap(event.target.content.bitmapData);
addChild(image);
imgFlag2 = true;
if (imgFlag1 == true)
{
completePreloader();
}
}
 function completePreloader()
{
loader3.load(new URLRequest(index.py));
addChild(loader3);
}
 function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded/e.bytesTotal;
myTextField.text = Math.ceil(perc*100).toString() + %;
}
}
}

Please advise.
TIA,
V
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Link Around a Bitmap

2010-02-27 Thread Susan Day
On Sat, Feb 27, 2010 at 8:58 AM, Susan Day suzieprogram...@gmail.comwrote:

 On Fri, Feb 26, 2010 at 3:25 PM, Nathan Mynarcik nat...@mynarcik.comwrote:

 Put your bitmap in a movieclip and add a listener to the Md so when the
 user clicks it navigates to the new page.


How do I create an array of which the elements--preferably of unknown number
 at runtime--are Sprites or MovieClips?

   TIA,

 Susan

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Little direction please

2010-02-27 Thread Anthony Pace
No lists I know of; yet, I haven't done any searching.   I taught myself 
the advanced aspects of JS in about a week or so of trying things out, 
so I am sure that anyone with even a little ActionScript 1/2/3, 
experience can pick it up really really fast.


I was going to write a hundred helpful tips (tag renewal issues, dynamic 
objects as complete containers, arrays as objects as arrays, custom 
event handling, cross browser issues, Function scope, Prototype 
programming, optimization, etc...); yet, I realized you may just want to 
check out the Douglas Crockford vids, read his book, and check out his site.


The play-list has the videos I am referring to and a lot more; yet, they 
are not in order, so I suggest watching, from beginning to end:


1: the javascript programming language  4 parts
2: advanced javascript 3 parts
3: theory of the DOM 3 parts
4: what ever else is available on the topic

http://video.yahoo.com/playlist/100205936

If you can find a different source for the videos, I would, because you 
may want to go back and forth, and sometimes the streaming stalls, 
forcing you have to reload starting from the beginning again  arrrgh.


the books he recommends:
http://www.amazon.ca/gp/search?index=bookslinkCode=qskeywords=0596101996
http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb

his site:
http://www.crockford.com/javascript/


On 2/27/2010 12:48 AM, Karl DeSaulniers wrote:

Hello,
I am not sure if this is a cross post, if it is, I do apologize.
Does anyone know of a list like this but for Javascript?
If anyone knows of one, I would greatly appreciate it.

Thanks,

Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Link Around a Bitmap

2010-02-27 Thread Gerry
Use a for loop like so...

var myArray:Array = new Array();
var someNumber:Number = 10;

for(var i:int = 0; i someNumber; i++){
  var mc:MovieClip = new MovieClip();
  myArray.push(mc);
}

someNumber will be your unknown number. I'll assume that you're going to get 
that from either a number 
of XML elements or some number that you set based on your needs.

-Gerry


On Feb 27, 2010, at 9:57 AM, Susan Day wrote:

 On Sat, Feb 27, 2010 at 8:58 AM, Susan Day suzieprogram...@gmail.comwrote:
 
 On Fri, Feb 26, 2010 at 3:25 PM, Nathan Mynarcik nat...@mynarcik.comwrote:
 
 Put your bitmap in a movieclip and add a listener to the Md so when the
 user clicks it navigates to the new page.
 
 
 How do I create an array of which the elements--preferably of unknown number
 at runtime--are Sprites or MovieClips?
 
   TIA,
 
 Susan
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Link Around a Bitmap

2010-02-27 Thread Susan Day
On Sat, Feb 27, 2010 at 12:29 PM, Gerry noentour...@gmail.com wrote:

 Use a for loop like so...

 var myArray:Array = new Array();
 var someNumber:Number = 10;

 for(var i:int = 0; i someNumber; i++){
  var mc:MovieClip = new MovieClip();
  myArray.push(mc);
 }

 someNumber will be your unknown number. I'll assume that you're going to
 get that from either a number
 of XML elements or some number that you set based on your needs.


Oh! That's easy ;)
Thanks,
Susan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Preloader, Pt. 2

2010-02-27 Thread Kenneth Kawamoto

Loader is used to load SWF or images.

loader3.load(new URLRequest(index.py));

Is your Python script meant to return SWF/image? If you want to load a 
data, use URLLoader instead.


But I think what you want is to go to another page, if so use 
navigateToURL().


Kenneth Kawamoto
http://www.materiaprima.co.uk/

Victor Subervi wrote:

Hi;
I had another idea on how to tackle this problem of wanting to load two
different swfs at the same time. (Please read thread if you don't understand
what I mean.) Then I want to call/load an URL. I get no errors, however, it
doesn't surf to the desired page, either. (Yes, I've loaded it on the
server.) Here's the complete code:

package
{
import flash.display.Bitmap;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.Loader;
import flash.events.ProgressEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFieldAutoSize;
import flash.net.URLRequest;
 public class Preloader extends MovieClip
{
var loader:Loader = new Loader();
var loader2:Loader = new Loader();
var loader3:Loader = new Loader();
private var myTextField:TextField = new TextField();
var imgFlag1:Boolean = new Boolean(false);
var imgFlag2:Boolean = new Boolean(false);

public function Preloader()
{
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
 private function init(e:Event)
{
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
// loader.load(new URLRequest(images/logo.png));
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded2);
// loader.load(new URLRequest(images/map.png));
loader2.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
removeEventListener(Event.ADDED_TO_STAGE, init);
addChild(myTextField);
myTextField.width = 250;
myTextField.x = stage.stageWidth/2 - 50;
myTextField.y = stage.stageHeight/2;
myTextField.selectable = false;
myTextField.border = false;
myTextField.borderColor = 0xAA;
myTextField.autoSize = TextFieldAutoSize.LEFT;
var myFormat:TextFormat = new TextFormat();
myFormat.color = 0xAA;
myFormat.size = 24;
myFormat.italic = true;
//myTextField.setTextFormat(myFormat);
myTextField.defaultTextFormat = myFormat;
}

private function imageLoaded(event:Event):void
{
var image:Bitmap = new Bitmap(event.target.content.bitmapData);
addChild(image);
imgFlag1 = true;
if (imgFlag2 == true)
{
completePreloader();
}
}
 private function imageLoaded2(event:Event):void
{
var image:Bitmap = new Bitmap(event.target.content.bitmapData);
addChild(image);
imgFlag2 = true;
if (imgFlag1 == true)
{
completePreloader();
}
}
 function completePreloader()
{
loader3.load(new URLRequest(index.py));
addChild(loader3);
}
 function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded/e.bytesTotal;
myTextField.text = Math.ceil(perc*100).toString() + %;
}
}
}

Please advise.
TIA,
V

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Security sandbox error during Upload/Download

2010-02-27 Thread Juan Pablo Califano
Hi,

From the error message, it seems your swf is downloaded from
mydomain.netbut tries to access
www.mydomain.net. Crossdomains rules are subdomain based so you are not
granted access to www.mydomain.net from mydomain.net.

Most likely, you have the absolute url hardcoded somewhere, so when you
access www.mydomain.net/my.swf it works, but if you change the url to
mydomain.net (which problably maps to the same file as www.mydomain.net), it
no longer works.

The easiest solution probably is using relative urls. If for some reason
that's not possible, anoher option could be placing a crossdomain.xml policy
file that accepts both www.mydomain.net and mydomain.net.

There might be other options (like forcing a redirect to one of the
subdomains, passing a flashvar with the actual domain dynamically using some
server side technology, etc) but I would just use relative urls, if
possible, or a crossdomain file.


Cheers
Juan Pablo Califano

2010/2/27 ktt kestuti...@yahoo.com

 Hello,

 I created file Upload/Download function with FileReference, but on
 different computer I get errors:

 Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security
 sandbox violation: http://mydomain.net/myboard/board-1.swf cannot load
 data from http://www.mydomain.net/myboard/uploads/some.jpg.
 at myboardFunctions::downloadKlase$cinit()
 at
 global$init()[/Users/demo/Desktop/board-new2010/myboardFunctions/downloadKlase.as:29]
 at
 myboardFunctions::formserts/downloadHandler()[/Users/demo/Desktop/Whiteboard-new2010.02.14/myboardFunctions/
 formserts.as:444]

 How to solve this?
 Should I need to tune Flash Player 10 settings?

 Thank you in advance,
 Kioshin



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Can u combine....

2010-02-27 Thread Juan Pablo Califano
I linke your solution and though I usually prefer to reuse objects such as
loader, I'm not totally against creating a loader per request since in some
situations it can be handy. But let me tell you, you have a subtle bug in
your code.

You need to pin down your loader somehow, because otherwise, since it's
local to the function, it could be garbage collected. I was under the
impression that an active loader would not be collected. It's rare that this
happens, but it's possible. I've learned this the hard way, and it took a
while and some hair pulling to figure out where the problem was (I was using
a Loader object to load images, but the same principle applies to
URLLoaders).

This could be fixed by storing your loader in an instance-scoped array, and
then removing it (and its handlers) when the loader's job is done (either
because it succeded or failed), using the event.target reference to find the
loader in the array.

Cheers
Juan Pablo Califano

2010/2/26 Valentin Schmidt v...@dasdeck.com

 Juan Pablo Califano wrote:
  Another option:
  function loadXML(dfile:String,arg1:Object,arg2:Array):void
  {
 
urlLoader.load(new URLRequest(dfile));
urlLoader.addEventListener(Event.COMPLETE, function(e:Event):void {
  parseXml(e,arg1,arg2);
});
  }

 and another option:

 save this as file myURLLoader.as

 package {
  import flash.net.URLLoader;
  public class myURLLoader extends URLLoader {
public var params:Object;
  }
 }

 and then use something like this:

 function loadXML(dfile:String):void
 {
   var urlLoader:myURLLoader = new myURLLoader();

  // add arbitrary custom parameters here
  urlLoader.params = {foo:23, bar:hello world};

  urlLoader.load(new URLRequest(dfile));
  urlLoader.addEventListener(Event.COMPLETE, parseXML);
 }

 function parseXML(e:Event):void
 {
   trace(e.target.params.foo);
  trace(e.target.params.bar);

  xmlFile:new XML(e.target.data);
   // ...
 }

 cheers,
 valentin
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders