Actionscript 3.0 :: Resize Loader That Load An Image Using It?
May 10, 2009How to resize Loader that load an image using as 3?
View 4 RepliesHow to resize Loader that load an image using as 3?
View 4 RepliesI need to add the image to an object as a child.. then resize it.. I know how to add it as a child (easy rly)[code]...
View 3 RepliesI'm trying to create a touch application through gestureworks, specifically by adapting this tutorial - [URL] I'm trying to scale an image down when the app loads with no luck.
[Code]...
I'm a complete newbie using ActionScript for a class I'm taking online (not my choice to have it online, unfortunately). My instructor isn't much help to me and I am struggling. I am a beginner Flash user so know a little about that program but it's the AS I'm struggling with. I will give you my first bornI am creating a simulation that contains an octopus in a bath tub for the main image.I'm trying to get the octopus to load on my stage using the code my instructor has given me:
var somePictLdr:Loader = new Loader();
var request:URLRequest = new URLRequest("octopus.jpg"); <--this is the name of the jpg I have. I'm on a Mac and the entire folder with all of my stuff is on my desktop named
[code].....
I'm trying to load an image in a movieclip using using the following:
Load_image_btn.addEventListener(MouseEvent.CLICK,Load_image);
function Load_image(event:MouseEvent):void{ var my_loader:Loader = new Loader(); my_loader.load(new URLRequest("C:UsersAmandaDesktoppicture1")); addChild(my_loader);}
[code].....
Im trying to load an image from my server with flash. The point is to do this dynamically so that I can animate it in flash on the fly. Im using ExternalInterface so I can feed flash some variables from javascript, but that doesnt seem to be the problem. I have ExternalInterface all sorted out it would seem. Anyway here is the problem code.
[Code]...
Can we load image or any asset from Library using LOADER in action script 3.0
View 4 RepliesI had a working normal time line code:
[Code]....
which works fine and loaded the image, however when I make a class file out of it it never load the image. The trace in the class did indicate that it was running >start drawing If anyone knows why,
[Code]....
I need to load (dynamically) an image stored in the library of Adobe Flash to the loader component. So far, i have imported this image to the library and exported it to ActionScript under the linkage section. I have named its identifier as well.
I am using ActionScript 2.0.
I want to load an image from altavsita into my swf with loader class.Then I get this error message.From my flashdevelop flash player everything works fine.But from all others I get:[code]
View 4 RepliesI need to load (dynamically) an image stored in the library of Adobe Flash to the loader component. So far, i have imported this image to the library and exported it to ActionScript under the linkage section.
View 3 Repliesim working on an image viewer and im loading an image to a loader and then add the loader to the stage.I want the user to be able to drag and drop the image but since it's a loader i dont know how to do it.
I tried
imageLoader.startDrag = true;
imageLoader.content.startDrag = true;
but im getting an error on both.
I'm building an Adobe Air app that needs to load external images from different webservers. I have my basic loader function set up, but I encountered one server that wouldn't let me load it's images. it gave me the following error[url]...
After that I got in contact with the server's manager and he told me he had been working on some basisc hotlink protection for his images. He also told me that I could subvert this by supplying[url]... as the referrer when building the request headers.
First of all I found no trace of hotlink protection with online testapplications for hotlink protection. Secondly I have no idea how to set up what he told me with a simple Loader class function.[code]...
[Code]....
As you see from the code above I have a loop that loads images on each pass using the same loader. This works, however, it is looping too quick (I believe) and as such the "addBook" function that handles pushing these into an array is pushing them into the array in the wrong order. Two questions: (1) Am I approaching this incorrectly? (2) If not, is there a way to listen to the loader event so the loop proceeds only after the load of that image is complete?
The purpose of this is too allow a user to upload an image from their machine to be displayed on a website. The code's pretty straight forward and i have it all working fine, but have come across an issue. When certain portrait images are selected to be loaded and displayed, they get rotated at some point in the process and become landscape? There doesn't appear to be any consistency to the way they are rotated. Some are clockwise, some counter clockwise.
The one thing i've noticed though, is that it doesn't appear to be an issue with images that have been re-saved (so simply taken into photoshop and then saved without any modification), only images that are the original source of an image taken by a digital camera? This has got me wondering whether there's a possible issue with flash reading the meta data of the source image? The attached zip file contains the source code and swf, a selection of images from 2 different camera's and a modified image.
Just to note, due to the dimensions of the images, in the source code the bitmap is scaled to 0.1 so that the result can be clearly seen. I've tested this without the scaling and the image still gets rotated. There's a trace in the Event.COMPLETE handler of the Loader.loadbytes() method and you can see from this that the width and height of the loaded image have been switched? Note - due to the size of the zip file (4.6MB) because of the images, i've put them up on my server for download instead.[URL]
I am working on image and i like to scale or resize the image by dragging and resize option.same working as "free transform tool" in flash (design part); i need same functionality in application.
View 7 RepliesI 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?
View 4 Repliesis there a way to set the loaded SWF's height and width to always use 100% of the Loader's height and width? pretty much like when you're embedding a swf to an HTML page... I know that you can do this by setting the width and height of the Loader on every stage resize, but is there another way wherein you can just specify height and width is 100% and then loaded SWF will automatically resize according to stage and Loader's current dimensions?
try loaded a SWF file which has coordinates based listeners and it seems that the loaded SWF doesn't reposition its listeners correctly even if the stage is already resized... take this swf for example [URL] i tried using an SWFLoader in flex which scales the content and also a normal AS3 flash.display.Loader and it seems that both fails to reposition the listeners correctly.
I have recently created a game in Flash CS3 with AS3 which displays a random picture (this is a pretty integral part of the game).I have written a small procedure to resize the picture to an appropriate size for the flash application. This is as follows:
ActionScript Code:
function onComplete(ev:Event):void {
var maxheight = 240;
var maxwidth = 400;
[code]....
Here is where it is called, please just take for granted that d_arr[1] contains the correct URL of the image I want to load :-)
ActionScript Code:
var url = d_arr[1];
var urlRequest:URLRequest = new URLRequest(url);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
[code]...
This resizes the picture when it is fully loaded. This seems to work fine on my own site, but on the sites to which mochi ads has distributed it, it doesn't resize the image at all, even if it is left to fully load.
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] .....
Here is my problem (unfortunatelly didn't find solution @google):I'm loading external swf[AS2] into main swf[AS3] using Loader class. The main swf is 800 x 600 and the external swf is 300 x 200.After adding the external swf to the main swf the external swf expands it's size from 300 x 200 to the main swf's size: 800 x 600.
View 1 RepliessiteLoader.as, Line 23 1061: Call to a possibly undefined method load through a reference with static type Loader.
[Code]....
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?
Some images I load dynamically are too big so I would like to scale them to fit the stage.
[Code]...
this returns 0. Why does it return 0 when the image loaded is obviously much larger then 0 pixels. How do I change the width and height of imgCont to a specified dimension.
How would I make an image I load using AS3's loader class into a button with an event handler on it? Below is what I have started. And below that is my error I get when I click the message.
AS:
//call function that starts loading my image
callButtons();
function callButtons():void {
[code]....
the error I am getting when I click the spanish.png on the stage is: ArgumentError: Error #1063: Argument count mismatch on MyVideoPlayer_CS4_fla::MainTimeline/playSpanish(). Expected 0, got 1.I NEEDED TO ADDED evt:MouseEvent
I have this piece of code to change images. I was trying to figure out how you could put a timer on the code, so if the image has been displayed for say 5 seconds it diverts to the next image automatically? Also if it's not to hard, when it has played to the end to divert to the 1st image.
[Code]...
[code]This script is for a loader image gallery in flash, as part of a class assignment. What happens is that in flash, when I open the swf file, the initial image (images/nair_evanescentautumn.png) will load fine. However, clicking on any thumbnail image (including the exact same images/nair_evanescentautumn.png), will result in an error saying the file cannot be found.I cannot figure out why it is doing this... I've tested it over. Clicking each thumbnail does go to the correct position in the two separate functions. All said full-size image links are in the folder images/, and replacing the initial loader image will load the other images in place of the default one. However, clicking on any thumbnail still results in URL not found, even though everything works correctly.[code]Before anyone asks why I'm putting this kind of content into a flash site, I'm not--this is only for a class assignment. I'm just trying to figure out why my images aren't loading right when I'm only doing the exact same thing in the functions as I am on the other pages.Of note, commissions.swf has the exact same feature, just with swf files loaded instead, and it works perfectly fine. home, traditional, digital, and photography all have the image gallery, and all have the same issue (I only referenced one page because if I can fix one page I should be able to fix all of them).As for the artworks, they are all my fiance's. The website design was built for her, and I used the website design for this project because I didn't want to have to build an entirely new interface design. Since the project also required a gallery, I felt that this interface would work just fine.
View 3 Repliesi am building an editor which allows you to resize images and to do this (once an image is selected) I add a visible border to the image that allows you to resize the image. so i want to have a function something like,
[Code]....
and i have to call this redrawborder function inside the MOUSE_MOVE listener that controls the resizing (so that i am constantly removing and redrawing the border). constantly removing and redrawing the frame seems very inefficient. is there some property or better why to do this? i want to have, displayobj.scaleChildren = false or something like that
I need to create a gallery to load images and display them. This part is fine:
/**
* @variable image_name to store the name of the selected item
*/
private function showimage(evt:Event):void
[Code].....
where imgMain is the id the image component.
But, I need a small twist. A transition image i.e. loading image should be displayed while the the image is being loaded.
When i try to load an external swf file using Loader.Load(); The swf starts playing even before the init event is fired. Is there any way to stop the swf from playing atleast until the init event or complete event is fired?
View 1 Replies