I'm writing a simple little test app consisting of 'main.as' and 'test.png', both within the same subdir on my harddrive. I'm compiling via command line with mxmlc, and testing via 'open with...' and Chrome. The code uses flash.display.Loader.load( "test.png" ) - but I can't access the loaded content (or even draw it to a bitmapdata!) due to security exceptions.
My goal is to get the image into something (preferably a bitmapdata!) I can draw to other bitmapdatas, as I understand this is fastest for gaming. I've tried all sorts of things, including creating a 'crossdomain.xml' that goes in the same dir as the above files (and doing the appropriate LoaderContext thing), tried various system.Security things and still no joy.
I've seen mention of there being some security risk with loading images and leaving them in loaders. A few articles I've run across said that you should always draw them as a bitmap when the loading is done.
Is there any truth to this? I have a few loaders I have left in my project, do I need to hand their content off to a bitmap? What is the advantage of always having a bitmap represent the loaded image?
How to remove a loader and its content using removeChild or any other way, I had removed the loader but its content still playing in the background i know that from the sound of the content.this is the my code for removing:
I am loading a fairly large image file and want to create a bitmap of the loader content. I want to then use this Bitmap and resize it according to the current dimension of the stage. However, I also want to keep the loader content as "originally loaded" as a reference in case the stage is resized and the user wants to view this particular image again. The way my AS is written as of now, I am manipulating the loader content. How do I not do this? How do I "copy" the loader content so I can manipulate the bitmap copy while leaving the loader content unaltered?
<AS> var lightboxImage:Bitmap = new Bitmap(); function resizeLightbox():void{ lightboxImage = myLoader.content; lightboxImage.width = myLoader.content.width; lightboxImage.height = myLoader.content.height; [Code] .....
I want to load an external image (dest) and display it on the stage, and i want to load another image (src) which will not be visible. When i hold the left mouse button on the image that appears on the stage, then a function that start copies the src image to the dest will be invoked. Actually i want to reproduce the scratch effect on an image that hides another underneath. here is my code [ the copypixels function is triggered on mouse_move event for debug purposes ]
Although the two images are loaded into memory and the first one is shown on the stage, when the mouse_move events triggers the corresponding handlers the copy does not work.
I have a problem with my New Loader class I use as3 and buttons to load external files into into my main swf file and I resize the external files to match my stage but they always load from the top left at x=0 y=0 The action script i use is
var swfHolder = new Loader(); mybutton_btn.addEventListener(MouseEvent.MOUSE_DOW N, mousedownpresser); function mousedownpresser(event:MouseEvent):void { addChild(swfHolder) swfHolder.load(new URLRequest("myvideo.swf"));
Is there any way I can load the external files into a different position?
Main movieclip onstage is : design_mc. Within it is a movieclip already in place onstage with an instance name clipart_mc.also loading a ListBox to the stage and each time a selection is made from listbox myLoader9 is used to load selected .swf intodesign_mc.clipArt_mc.Now within each of the .swf files loaded into design_mc.clipArt_mc there is a mc ike to color transform called color_mc.So now the listbox is onstage and I make a selection that places heart.swf inside of design_mc.clipArt_mc. I want to access heart.swf so I did this:
var child:DisplayObject = myLoader9.content.contentLoaderInfo.content.color_mc; var colorTrans3:ColorTransform = new ColorTransform(); var trans3:Transform = new Transform(child);
So, i'm currently working on an xml based banner. The banner has seven "pages," each with it's own image and url (specified in the xml file).A preloader loads in the swf, and then another loader in the main swf loads in the xml and images (displaying percent loaded and whatnot).
The problem that I'm running into is that I can't figure out how to access the previously loaded images when I want to call my transition function... I added as many comments in the fla as I could, if there are any questions feel free to post, I'll be here all night.
All in all, I need a second set of eyes to skim my project and help me streamline the process.
I'm having troubles accessing the data loaded by external class.[code]...
Now, I want to create another external class (called MainMenu) that will be initiated from the Main class.This class should create the menu based on the loaded XML class.
My question is, how can I make use of the loaded XML content via XMLLoader class within the MainMenu class?
how to create an image gallery that loads external bitmaps. It also has some nice fade in/fade out effects using Tweener. I was wondering, what would I need to modify from my code to load MovieClips from the library instead of the external JPEGs.
Code: import caurina.transitions.Tweener; var btn:Object; var disabledBtn:Object;
In AS3, I am loading a png from a zip file (nochump's zip library through ByteArray to Loader). The png can be up to 45k pixels wide but only 120 tall. This creates a problem in flash, as images can only be ~8000 pixels wide. A possible solution would be to split the images into 6 columns somehow. This would probably need to be done in the ByteArray state, because the limitation is in Bitmap and Loader.
The title describes the problem: Loader.load() is firing the INIT event, but in my listener it's reporting loader.content as null. The description for INIT event is "Dispatched by the associated LoaderInfo object when the properties and methods of the loaded SWF file are accessible."I'm loading a lot of JPG images, and 95 percent of the time it works fine; the init listener fires and reports valid loader. content.I absolutely need loader.content available because I need to set the bitmap smoothing property to true.I've tried using Event.COMPLETE and it has the exact same problematic behavior.
I'm have made some buttons (movie clip) and when I click on it, I want a file (home.swf) to load in a loader (mx.contents.loader) and I want the other buttons to do the same, all load into the same loader. I have no Idea how to do that. The way I have it set up now, the home.swf will load over the entire screen and that is not what I want. I just want the content to load into the loader and have its content change once I click on the other buttons. Here is a copy and past of that I have at the moment, I'm using Flash 8 to do it all.
I'm using a PHP proxy script to load images from Facebook into Flash without any sandbox violations. It is taken from the guide here: [URL].. The relevant PHP code is:
[Code]...
The guide mentions that additional security measures are recommended for a real world application. What additional measures would be applicable to this? Maybe some kind of key passed from Flash to PHP?
I realise that there's nothing I can do to completely protect the Flash from being decompiled, but can I prevent the script from being used maliciously?
I have a .swf file at one domain that is trying to play a video on my influxis account. So far, so good.But I am trying to draw a bitmap based on the video that is playing on my influxis account and I am getting the following error:
Can someone explain how the cross-domain policy file works? Like, do I need to place the policy file on the same server as my .swf or on the server with the influxis account?Influxis has a admin panel where you can set a referring domain, do I just enter the domain of my .swf file?Also, do I have to add actionscript to my .swf file to access the policy file?
This is a two fold query involving the same issue. As you know, if you attempt to use bitmap.draw() with an object (image or swf) that is not in the same domain as the calling swf the bitmap will not draw. As described by Adobe livedocs, if Security.allowDomain() is setup in the calling swf then draw() will work. However, I cannot get this method to work. I have supplied an example fla (make sure to get the .as for it too).
1. How do I get Security settings right to permit bitmap.draw() to work with objects from another domain? (not any domain - just the domain I define in the allowDomain parameter)
2. How do I setup an event handler (listener) for bitmap.draw() so I can detect when it doesn't draw?
I have a main "shell" swf which, by clicking several buttons, will load/unload various external swfs into a Placeholder_mc which resides on the main timeline in Shell.swf In the documentation and tutorials I've seen a couple different methods, and I'm not sure I quite understand the difference, or at least the reason you would use one over the other...In the 1st method, you can just add the Loader object using the addChild() method:
Code:
var myLoader:Loader = new Loader(); var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf"); myLoader.load(myURLRequest); Placeholder_mc.addChild(myLoader);
This will apparently add myLoader to the display list once it has completely loaded.The 2nd method, you supposedly can add the Loader.content; however, it appears you can only do this once the content has completed loading, so you need to incorporate an event handler with the contentLoaderInfo object:
Code:
var myLoader:Loader = new Loader(); var myURLRequest:URLRequest = new URLRequest("ExternalFileA.swf"); myLoader.load(myURLRequest);
[code]....
What are the pros/cons of adding the entire Loader object, as opposed to the Loader.content and vice versa?
So, you have a sprite, you draw some graphics, you set cacheasbitmap=true... I can't seem to access the newly created bitmap data, to access the dispose() method.
I try to "catch" this error when I'm loading some images.The following code is an test-case for my problem to secure that there are no errors in the surrounding code.
I'm working on an interactiv-movie with many images and movies which are loaded dynamically in the application.In this snipped I generated the worst case in my application (try to load an image that not exits).When I run this code I get the trace "SecurityError: Error #2000: No active security context" and not the trace of my the Listener.
find the code to pull some simple text from an external website's RSS feed into a basic text box in a Flash movie. It would need to be in AS2 to fit with the website. I understand I need to pull the content via an xml / php page under my own domain in order to get around the Flash security, but I still can't scrape together the right code for it to work.
FLash CS5 Actionscript AS2 Publishing for player 9
I'm using Flash CS3 Pro. and actionscript 2.0 for my flash documents.I have a flashfileA.swf which is a picture of a rotation shoe (view here)it has a slider bar that calls the action to zoom while rotating. if you checked it out, it works fine.
so I have flashfileB.swf that I load that flashfileA.swf into. Initially, I was getting pages of pages of "Security Sandbox Violations".
I added the code:
Code:
System.security.allowDomain("*");
in flashfileB.swf and that seemed to get rid of all of the violations but the slider doesn't zoom the shoe when I'm using it in flashfileB.swf I need to get the zoom to work while it's loaded within flashfileB.swf and I'm assuming it has to do with the way I coded it.
I'm loading a list of urls of pics from an fql query, then loading those urls with the loader class using this function:_loc is a MovieClip that holds the picture,[code]In onMyPictureLoaded I would like to get the bitmapdata out of loader.content and scale the image (smooth it too) that way, and then reattach it to the _obj MovieClip, but I'm having trouble reattaching that new bitmap to the object.It seems the problem is more to do with events and not having the ability to pass information (_loc, for example) from:loader.contentLoaderInfo.addEventListener(Event.CO MPLETE,onMyPictureLoaded); to the onMyPictureLoaded function.
I was trying to build a class that would load external bitmap images into Bitmap objects. I'm having a bit of trouble as the image loads, but does not display visually. Heres the code to instantiate it:
ActionScript Code: var loadd:Bitmap= new Bitmap(); ImageLoad.loadImage( loadd, '../ght.png' ); this.addChild(loadd); And heres the class:
I'm trying to integrate a Flex app with Google Checkout and code that runs fine on my local machine is throwing a Security Error when I test on my site.[code]...