Flash :: Resizing Loader After Loading Swf?
May 6, 2010
I'm using the following code to load an swf in a pure actionscript project (Flex Builder 3)
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, Loader_Complete);
_loader.contentLoaderInfo.addEventListener(Event.INIT, Loader_Init);
var request:URLRequest = new URLRequest("Skins/TestSkin.swf");
_loader.load(request);
[Code]..
I have seen examples online where people say these work for them but whenever I set width or height in any of these ways, the loaded swf is simply not displayed at all.
View 1 Replies
Similar Posts:
Apr 1, 2010
I want to have an AS3 app load images from url supplied by the user. But I don't want a malicious user to be able to load an SWF file in place of the image, such as with an altered extension "maliciousSwf.png". Well, not sure how big a security threat that is above and beyond the ability of the hacker to decompile swf, but I think that ideally such behavior should not be allowed.
So, is there any way to prevent this? When people allow users to load images in their Flash apps, do they somehow guard against loading of SWF? Or is this really absolutely no big deal?
View 1 Replies
Oct 14, 2010
I'm trying to resize a .jpg file that I'm loading in the loader class, and I can't get it to work. Here's the code I'm working with. (Note: I had to cut the URL to the jpg out because the forum blocks me from posting URLs with images!)
ActionScript Code:
getURL = new URLRequest("*URL to a jpg goes here*");
// Load slide image from URL
[code].....
View 2 Replies
Jan 2, 2012
Ive found all sorts of answers but not the right answer. Im using the loader class to load images into a gallery. Im placing the image inside a movie clip. I want to resize the images as users will dynamically load them but width is not working. scaleY works and scaleX
[Code]...
View 2 Replies
Mar 11, 2010
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
[code]....
View 1 Replies
Jun 26, 2007
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;
[code].....
View 1 Replies
Nov 10, 2010
My main swf is 960x600 and loads full screen. it is a projector or swf, local. I have the code on frame 1 to ensure full screen and show all:
stage.scaleMode = StageScaleMode.SHOW_ALL;
stage.displayState = StageDisplayState.FULL_SCREEN;
Then I load an external swf into a mc, and it goes full screen as expected. BUT the main swf that loaded that external one, at the time of load, suddenly gets scaled back down to its normal size: 960x600, on the top left corner of the Player Window (or the full screen), so somehow at 0,0. Whn I unload the external swf, I can put the code stage.scaleMode = StageScaleMode.SHOW_ALL; to get it back to where it was. But unfortunately I have some buttons from the Main swf that are supposed to be on top of the loaded one, and should stay where they are. But now they all move because of this scaling down.
the mc that is being used as a container for the loaded external swf is an empty mc located at 0,0. The external swf has the same size as the main one: 960x600
I searched and tried things but could not get it to stay in show-all mode when loading this external swf...
View 0 Replies
Apr 5, 2011
im loading photos of different aspect ratios with a loader onto a child holder frame_mc. I wanted to know what AS3 commands do i need to work on to get the frame_mc to resize to the new childs dimensions and centerize itself on the main stage? (as in event listeners, functions, vars etc)
View 3 Replies
Apr 22, 2010
I'm having trouble with a simple loader not loading an external swf file.I have a set of menu buttons (created from a class) that store the swf file name. When these are clicked they run a function that supposed to load the swf file but for some reason it doesn't (but maybe it does load it, just not display it). So here's the code:
Code:
var urlLoader:Loader = new Loader();
var pageHolder:Sprite = new Sprite();
[code].....
View 3 Replies
Jan 17, 2011
I'm having trouble with a simple loader not loading an external swf file.
I have a set of menu buttons (created from a class) that store the swf file name. When these are clicked they run a function that supposed to load the swf file but for some reason it doesn't (but maybe it does load it, just not display it). So here's the code:
Code:
var urlLoader:Loader = new Loader();
var pageHolder:Sprite = new Sprite();
pageHolder.height = 420;
[Code]....
The "page loaded" trace is being displayed, so must load the swf but not show it.
I can't even see the preloader. I also tried a very simple swf file with just some shapes and 1 frame but still no luck.
View 1 Replies
Nov 13, 2011
i like to ask about one thing If i create Loader and load external image by URLRequest , ill have result :
loader.content is Bitmap loader.content.bitmapData is BitmapData But if I use Loader.loadBytes(ImageBytes) , result is different even if ImageBytes is loader.contentLoaderInfo.bytes :
bytesLoader.content is MovieClip
bytesLoader.content.getChildAt(0) is BitmapData
bytesLoader.content.getChildAt(0).bitmapData is BitmapData
View 1 Replies
Jan 21, 2010
I am developing a Image uploader using Flash 10. I am using Filereference object to browse images and Loader to show the image:
Sample code:
var tempFileRef:FileReference = FileReference(ev.target);
var oLoader:Loader = new Loader();
oLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoad);
oLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
oLoader.loadBytes(tempFileRef.data);
It works fine with .jpg and .gif files but when I browse .bmp or .tiff file, I am getting the error:
Error #2124: Loaded file is an unknown type.
Is there a way to load and display browsed .bmp images from desktop?
View 2 Replies
Aug 6, 2010
We have a Flash game which need to be loaded and played from an AIR app. using the swf loader, the game swf is loaded into the AIR app. But the static background layers of the swf are not appearing in the loaded game.
Those graphical elements which are generated via action script only are appearing. When we are playing it independently (outside the AIR app), it works fine. Is there a setting that i am missing in Flash or Flex. we are working with Flex 4.
View 1 Replies
Aug 12, 2009
im 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.
View 2 Replies
Nov 13, 2009
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."
View 2 Replies
Sep 21, 2010
I like to play external preloader before it's load original movie index.swf. But I have a problem on resizing index movie. Sample files on link [URL]
[Code].....
View 1 Replies
Apr 22, 2009
iam trying to insert more consequtive images. the names of the images available in ana array imgarray. here my problem is. it is loading and resizing only hte last image. except last i cannot see any other images is not getting load..
find below the code i used. i want to close the movieclip (masterimg) and load the images from array.
[Code]......
View 1 Replies
Sep 27, 2010
I'm loading external swf into my main project for sub sections to keep size down.My main project is 1280 x 700px in size.In those sub-section I have some content with a scroller.When I load the swf and check the size its ok. But as soon as the scrollbars is initialized scroll bar is initialized the size of the external includes the text that goes off-stage for the sroller.I can resize it propotionaly when after its loader because i have the correct values. But if the user resizes his browser I get the wrong values and my resize code doesnt work because it's height is now incorrect.So is there a way to not include the off-stage elements to count as the height ?
View 1 Replies
Sep 23, 2008
When I load an external SWF into a container (be it a sprite or mc), and then retrieve the contentLoaderInfo for 'height' and 'width', and attempt to resize the either the SWF (loader content) OR the Sprite/MovieClip to a smaller size, using the loaderInfo to maintain aspect ratio, it resizes all the elements that are offstage as well.
[Code]...
View 7 Replies
Apr 22, 2009
iam creating a pallete in that i have a class movieclip with 1 image and 2 text (title, desc). Here iam connecting a xml and creating the same class and adding it to the scrollpane. in that each item (movieclip) i need to load images and fill the text. iam filling the text and loading the images. but i need to scale the pictures to 35x35. actual size of the pic is 70x70.my code is :
function fillitem() { var ypos:Number = 10; //reptitle.text = myxml.toptitle;
reptitle.text = options[0][0].tit; var tf1:TextFormat = new TextFormat(); tf1.color = options[0][0].col; tf1.size = options[0][0].siz; tf1.bold =
[code].....
View 1 Replies
Jan 5, 2010
I am currently trying to build a news application in which I load news (text) and images files from an XML file. Because the native images are too small I also want to resize themI don't seem to be able to get the resizing part to work. Here is my code (only the relevant funtions):
ActionScript Code:
function laadXML (event:Event):void
{
[code].....
View 0 Replies
Oct 20, 2009
I want to load an external swf to the background and then have it resized proportionally according to the browser window so it can fill up the whole screen.
View 2 Replies
Jun 25, 2009
I am resizing games when i call them with JavaScript. Now I am calling a preloader with JS, and the preloader calls the main SWT. The problem is I need to resize the main .SWT.Do I resize the SWT from the preloader? Can I do it from Javascript?
View 0 Replies
Oct 20, 2009
I want to load an external swf to the background and then have it resized proportionally according to the browser window so it can fill up the whole screen. Could anyone point me to any online tutorials or show me how to do it?
View 0 Replies
Oct 8, 2009
When using Loader class to load display objects (bitmaps, SWFs...) from remote URLs, is there any way for them to be instantiated (referenced as we know, by Loader::content property) as some user specified valid subclass? For example if I had a class that extended a Bitmap, is there any way for the loaded object to be of this class?
View 9 Replies
Mar 22, 2011
[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 Replies
Nov 10, 2009
I am doing my first all out flash site without a template and tried several different ways to load a external swf file to the site vie ui loader... it works fine on my local computer but when i put it online the external swf doesn't show at all while the rest of the site does, and im not getting any error..
View 17 Replies
Apr 14, 2010
I want to change the following code being used to load my external flash swf to an empty swf so that a loader is used instead of loadmovie:
var dewsliderpath = _root._url.substring(0, _root._url.lastIndexOf("/")) + "/dewslider_ori.swf?xml=" + xml;
DewSlider.loadMovie(dewsliderpath);
[code].....
View 1 Replies
Jul 30, 2009
I've set up a swf with three buttons and when you click on one it loads a different swf and places it into a movie clip. If there's already something in the movie clip it removes it and then replaces it. The problem I'm having is if one of the swfs is very large and for whatever reason someone clicks on a different button where the swf is smaller it will load the smaller swf but continue to download the larger one and when that finishes it will load on top of the smaller one.Here is my code:
ActionScript Code:
var home:MovieClip = this;
var ldr:Loader = new Loader();
[code].....
View 9 Replies
Feb 18, 2011
I have a flash animation made on the main timeline of the SWF with a couple of layers, some functions and some keyframe labels. For example, i have a movieclip of a star that come across the screen and then trigger a dispatchEvent for the main timeline to go to frame label "next".[code]That SWF alone works perfectly. Problem come when i try to load this SWF into another one. What happen is the loader keep reloading the SWF over and over, overlapping them and the actionscript that's on the main timeline of the loaded SWF is ignored, the timeline plays continuously. Here is the code i use to load the SWF.[code]I have found a workaround by putting the entire animation inside one main movieclip and put that movieclip on the main timeline (one keyframe, one layer, no actionscript) and then load it. That way it works fine but it feel more like a patch than a solution. I would really like to know why it's bugging when you try to load an external SWF that use the main timeline with multiple layers, keyframes and actionscript.
View 1 Replies