I have my .fla file and .swf file in a folder on my desktop
i want to add to that file a bitmap. everytime my flash project receives a the String "loadBITMAP" i want it to reload that bitmap into a designated area on the stage. (i am using a system of binary sockets to recieve data, but don't worry about that...i know how to process that already.) so basically my code will say
Code:
if(socket.readUTFBytes="loadBitmap"){
need code here on how to load bitmap
}
I'm trying to clone / duplicate an object loaded in at runtime via the
-- ldr = new Loader(); var mRequest:URLRequest = new URLRequest(targetFile); --
technique. The problem I think I'm having, is in understanding what exactly the loader returns and how it can be used. after loading an image and tracing the result after the loader completes like this ...
trace(ldr.content); // - traces [object Bitmap]
I have a fuction I built that returns an arrar of clones / duplicates of a passed bitmap ...
when I run the code there aren't any errors stopping it from compiling correctly. However when I click on my buttons i get an error saying:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
I'm guessing that I'm passing the variable off through the function incorrectly. I'd like it pass a string though so that I can pass the name of the file to load.
ActionScript Code: function contentScreen(mcName):void { var imageRequest:URLRequest = new URLRequest("mcName"); var imageLoader:Loader = new Loader();
I've recently made the switch from as2 to as3 and am still struggling to get my head around one aspect in particular. I've managed to load one external swf into a blank file via the script
import LoadDisplayObject; var loader:LoadDisplayObject = new LoadDisplayObject("button_01.swf", true); loader.addEventListener("displayObjectLoaded", onComplete, false, 0,
[Code]....
.....however I'm struggling with the script to make a swfs load into a space when one of my 3 buttons is clicked....
My page currently has three buttons (button_01, button_02 and button_03) and in a local folder three separate swfs with the same names which I wish to load in, when the appropriate button is pressed.
I have managed to get them to load in using a tutorial...however they load over the top of each over...far from ideal. From research on the internet I've found a range of different script...but I just can't find anywhere I can find script to make this work..hence why I have turned to here.
I am a bit stuck here for the past few days. I have a SWF running in Security.LOCAL_TRUSTED sandbox. I can load my JPEGs and simple SWFs without any problems
how to load an external using a loader to show while its loading...my swf which is to be loaded is a gallery having jus one frame on which action script is placed..
I've devised a preloader using the ui loader and progress bar components in flash cs3. The goal being to load an external .swf into the uiloader and that has been achieved. I'm having problems with the scaling now. In my code I have set the content scaling to "true" and that isn't supposed to cause distortion of any type but it does. It squishes my external .swf in width wise.
HTML Code: var imageURL:String = "portfolio.swf"; var imageURLRequest = new URLRequest(imageURL) uiLoader.scaleContent = true; uiLoader.load(imageURLRequest); progressBar.source = uiLoader; [Code] .....
I want my product button to click on it, to load an external sfw into a loader and the text of this external swf too. The text is loading good when i click the swf file on its own, but with the index page not. when i click the product button the loader is loading only the swf file of product but not the text on it. The text is coded to the product swf.This is the code of index Page which i want to load the product page:
I've been trying to figure this out for the past couple of days and couldn't find a solution and Im sure its something I have completely overlooked on my part. I'm attempting to load in an external swf in my fla file using this custom loader class I created. I keep receiving this error in an attempt to load the swf, which is in the same directory as my fla file that is loading it:
TypeError: Error #2007: Parameter url must be non-null. at flash.display::Loader/_load() at flash.display::Loader/load() at com.proj.load::SWFLoadClass() at test_fla::MainTimeline/frame1()
Using the MovieClipLoader class, what is the difference between loading the external files into a Loader Component or into an empty movie clip. Will one be quicker? They both worked for me, but I've read using the Loader Component is better. Can anyone confirm this? I would think that avoiding components would make things faster/less file size.
I am trying to import a SWF file into a custom loader and then treat the loaded SWF file as a MovieClip object. The code for the functionality can be seen below.
public function loadMyMovie(movie:String) { var now:Date = new Date(); var rnd:String = "?randomize=" + now.time;
[Code].....
When I do this I get the following error.
"Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip."
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.
Can you put event listeners on bitmaps? Because the current project that I'm working on requires a lot of separate objects which are currently MovieClips, and because there can be several hundred, it causes the app to lag.
I got this very strange behavior from FlashPlayer debugger 10.1 r82. When I call loader.load method, no ADDED event is dispatched to the loader object. But if I open the file and call loader.loadBytes instead, an ADDED event is dispatched to the loader object. I suspect the ADDED event is dispatched because the content is being set as the child of Loader object, but why in the other case it is not dispatched?
i have a swf running on a movie click at the root level and a button at the same level, i would like to change at runtime the source of the swf with a mouseclick, i now a variable can do it but my question is...is i change it with a variable the existing one will get killed avoiding duplicates and overlapping of swf?
this only happens when I'm running from my local web server. The external swf get loaded just fine and I get the progress event, but just not the complete event.
Here are the three events I listen for currently myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, OnGameLoaded); myLoader.contentLoaderInfo.addEventListener(Progre ssEvent.PROGRESS, OnGameLoadProgress);
I've created this code to loop through an array of image names and load them to the stage. Currently I'm just stepping them down 175 pixels each, which eventually I'll want to offset by the height of each of them (but I'm having an issue with that too lol ). Anyway...my question is, I've seen code to add event listners to each movie clip dynamically, but that code was working on static movie clips. I want to add the listners to my dynamic images and I'm not sure what that should look like.
[Code]....
I know this isn't correct, specifically in the captureAllClicks function...but I'm not sure how else to reference the current item since it was dynamically generated.
I have stuck a bitmap into a display object container (Sprite). On a given mouse event (i.e. mouse click), I would like to display the x and y coordinates of the bitmap. However, I've realized upon clicking on the bitmap, the event is only recognizing the higher level Sprite container. I suspect this could be attributed to the simple fact that bitmaps are not InteractiveObjects.If it's I have attached the code. I am loading a master image and cloning it to produce a thumbnail image (bitmap). Mouse events with the container holding the master image recognize the image itself while the container holding the thumbnail only recognizes the Sprite container.
Code: var ldr1:Loader=new Loader(); var url1:URLRequest=new URLRequest("PhotoGallery0/picture0.jpg");
I'm looking for an alternative to using: stage.addEventListener(KeyboardEvent.KEY_DOWN, keyFunction);
The problem I am encountering is that eventListener above works fine on its own(stand-alone swf), but when loading an .swf externally into another .swf, the listener fails with the following error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
How can you target the event listener when loading as an external .swf differently?
Ok I wrote an application where I have panels that the user can draw on, kind of like paint, but they can create panels. Now I want them to be able to save and load their work. Using Quasimondo's bitmap exporter, I was able to save a bitmap (200x200), and the application prompts the user where they were to save the image file. However, my problem is that the user will probably have 6-12 panels to save, and so I want the program to save all those panels so they can be loaded later.
Now in order to load, I don't want the user to manually select each panel to load. I want the user to select one file and it will load all the images into the panels. I was thinking about maybe loading a zip file and flash would extract the images and load them, but I don't know if that's possible. I think the user would need to select an XML file,which would direct Flash to what files to load and in what order. For this, and I'm assuming when it saves the flash application/php, it would need to write a new xml file.So I guess what I need to know how to do is:- How do I get flash to save several images to the server or the users hard drive- flash to generate an xml file- is there any way to make flash combine all the files into one file so that the user doesn't have to deal with several files?
I've been learning AS3 for a while now, and it's my first Actionscript language, but not my first coding language. I've learned a lot so far, but I started off doing things in the not so efficient, or correct ways. I was putting all of my actionscript on frames. I'm trying to get in the habit of doing it the right way now. But I'm having a basic problem. I can't figure out how to load a bitmap from the library in AS3.
To do this does it mean that I have to store them in another external location rather than my library and only load them when I need to use them from a URL request?
I want to load .jpg images into flash and store them as BitmapData objects. I've coded the loading of images many many times but I've never tried to store them as BitmapData, I just usually add the Loader to the display list and manipulate the image through its loader.
I feel like this is a very poor approach and so I want to try just saving BitmapData, because on the Model side of things thats really all I need.
Now the only way I have found to extract BitmapData from a loaded JPEG is to load the JPEG and upon completion write:
myBitmapData = Bitmap(loader.content).bitmapData;
First, is there a way to extract the BitmapData without encumbering the code with the Bitmap class? In other words, is there a way to extract that information without involving the Bitmap class - BitmapData while useful for a Bitmap is not dependent on Bitmap so ideally I would never involve Bitmap here.
Also, why is this Bitmap type-casting so widely accepted? loader.content is a DisplayObject and therefore is not necessarily compatible with Bitmap. Further, for all Flash knows we just loaded an SWF and as far as I know you can't typecast that to a Bitmap.
I have the following code which simply loads an external swf, puts it in the right place and should all be hunky dory.This works:
Code: var myLoader:Loader = new Loader(); addChild(myLoader); var url:URLRequest=new URLRequest("foobar.swf");[code].....
to set the dimensions of the loader so the external swf doesn't 'spill over', the result is a blank screen. No matter how high I set those dimensions it just doesn't display anything.
I am attempting to load multiple images in AS3 and I'm exploring different options on how this can be done.I would like to have to only use one Load() instance and handle the various image assignments in the onComplete handler...here is my first attempt:
var buttonLdr:Loader = new Loader(); buttonLdr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); buttonLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadCo
Sorry for the complicated topic. I got a .swf that loads in other .swfs. Rather than figuring out how to make a loader for loading .swfs I thought I'd just use a simple loader in the .swf I'm loading.
However, it doesn't work. It starts fully loaded but doesn't finish. Heres the AS:[AS]_root.stop(); PercentLoaded = _root.getBytesLoaded()/_root.getBytesTotal()*100;
I'm trying to figure out the best way to compare a single bitmap against perhaps an array of saved bitmaps to see how close of a match it may be to any one of the bitmaps stored in the array. Right now I'm running a for loop that uses the bitmapData.compare() method to try to compare to see how much of a variance there is but... to be honest I'm at a loss as to how to use the resulting data to do so. Does anyone know of any good method to accomplish what I am trying to do? Forget looking at my code it's a waste of time because simply, it's not working.
I have 2 questions regarding bitmaps. Say I'm loaing graphics from a game off a server into a .swf file: 1) Which format is the best to use - gif, jpeg,png? (for non transparent images) 2) When a user plays a .swf movie it gets saved to their browser cache and its loaded the next time they access the same file, but when your externally loading images does flash have to re-download all the images or is it all stored in the browser cache?