ActionScript 3.0 :: Loading External Images Won't Work Within A Class
Aug 27, 2009
I'm trying to load external images in the usual way;
Code:
loader=new Loader();
loader.load(new URLRequest(_thumb));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);
private function onLoadComplete(e:Event):void{
thumb.addChild(loader);
}
But when it comes through to the onLoadComplete Function, I get a sandbox violation. I've tried using Security.allowDomain and a crossdomain.xml file, but it just won't work. Even more annoyingly, if I do the exact same thing, but within the main class file, it works fine.5 or so of these classes that need to load images are loaded from an XML file (which also works fine without allowdomain etc). Is there some sort of conflict going on because of there being more than one of them?
View 1 Replies
Similar Posts:
Jun 23, 2010
i got a problem with my gallery. my script only loads the loadImageComplete function, when all Thumb-Images are loaded. I want the loadImageComplete-function for every Thumb/Image.
Code:
function loadThumbs(src:Array,name:Array) {
var xPos:Number = thumbXStart;
var yPos:Number = thumbYStart;
[Code]......
View 0 Replies
Aug 23, 2010
But it works fine locally.
I've created an extremely simple flash website. I need it to display some pictures and to keep the filesize down I want to load these images on demand. The images are hosted on my server in folders in the same directory as the website swf and the html file that initializes the swf.
I use the most rudimentary way of loading an image, it looks like this:
Code:
var loadStart:Loader = new Loader();
loadStart.load(newURLRequest("images/start/screenshotstart.jpg"));
startScreenshot.addChild(loadStart);
When I upload the website to the server it simply does not display the image, it's not loaded, the place where it's supposed to be is blank.
I've searched the site and there have been some threads with similar issues but the answers given just don't seem relevant. Something about cross domain policies, but all my images are on the same domain as the website swf.
View 2 Replies
Jun 27, 2009
Lets say I have Main.swf and sub.swf, and I wanna load sub when I press a button from Main, but sub.swf has its own external class file attached, so here is the problem, when I load sub using loader class and I would get this message from the output panel:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at subScript()
seems loader class can not access sub.swf's external class when sub is being loaded.
View 1 Replies
Apr 13, 2010
I am making a flash site of all of my lingerie that I sell. There are over 200 pictures that amount to over 20 Mb. I would like to know if placing these images externally would be better than trying to put them in the flash movie file?
View 1 Replies
Dec 12, 2011
Im working on a large project that requires text and images to load from an xml file. I have the text working like it should, but have problems with getting images. Its basically an interactive powerpoint IE: swf loads, shows menu selection buttons, when you click a lesson, you can go through different pages of info, I need to load images based on whatever page its on. Example: Lesson 1 has 4 pages of info, when you click the next button, a different picture needs to be displayed.
View 4 Replies
Sep 19, 2011
I have been trying to create a preloader for a quiz I have made, and it causing me crazy amount of stress. The loader its self is very simple....
[Code]...
So there is nothing too strange there.... the problem I am having is that my quiz has a timer on it, and on the first question the timer does not work.. On the odd occasion it does like 2 seconds and then freezes. I am completely lost to why it is doing this! The quiz works PERFECTLY when not being run via the preloader, so it must be related to the loading process itsself.
View 1 Replies
Dec 16, 2011
I have saved a dozen Fonts into separate swf files (embedded in the library of their respective .fla files). I am loading up to four of them and whilst most of them work, the script silently fails for Arial and Times New Roman. These fonts have been embedded and compiled the same as the others, and when I trace the available fonts I get an object saying that the required font has been loaded ([Object { fontName="Arial", fontStyle="regular", fontType="embedded"}]), however the text is not being rendered. If I change which font to use then the text is rendered using the correct font and performs as expected. It is only with these two fonts that I have a problem with.Is there a common problem with embedding these two fonts or is it possible I have changed a setting somewhere?
View 1 Replies
May 17, 2010
I have an swf movie embedded into HTML (it's designed to work as a webpage) but for some reason my links to load external swf movies into a placeholder don't work when the main movie is embedded, but are fine in a flash player.
View 5 Replies
Nov 13, 2009
I havent been on here in a while, and about the same time I have gone without programming.Here is my delimaI have a game and I need to load an .as into a section of my flash. this is the code I have. It's on a "Checker" movie clip.[AS]
onClipEvent(enterFrame){
_global.eyes = _root.eyesP._currentframe; //Global Eyes Setter
_global.mouth = _root.mouthP._currentframe; //Global Mouth Setter
[code].....
View 2 Replies
Nov 15, 2008
I'm loading a external image and want a preloader for this progress.I found this code for a preloader, but how do I connect it so it preloads the image?
View 3 Replies
Apr 15, 2009
I'm new to AS3 but trying to learn. Please be kind and forgiving. I just want to load an external image. I have been cruising the Web for days. Why doesn't this work:
var imageLoader:Loader = new Loader(); imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoadComplete); var request:URLRequest = new
[code]......
View 2 Replies
Sep 1, 2010
I am trying to change the images the following calls up. (Using CS4 and AS 2.0)
onClipEvent (load)
{
imageProperties = _root.getCurrentImageName(0);
loadMovie(_root.url + imageProperties.name, this.cont.pic);
[code]....
I get that I could find the image in the directory and just change it out with the same name/pixel size, but I'd also like to add more images to this particular project with the same conditions.
View 1 Replies
May 27, 2008
I am trying to load external images and .swf's for the first time and was wondering if anyone had any tips, or tutorials they could send my way. I am working with large imagery inside a flash banner animation and I know there has to be a quicker way to get them to load.
View 7 Replies
Apr 1, 2010
I have just started messing around in flash and made a pretty cool site (...design wise, the action script part is my major problem right now) which is suppose to go online sometime soon. I used the following script to load an external SWF into my main SWF: (I placed this script in the main timeline of my 'main' movie on frame 100 or something)
[as]
if(this.contentHolder == Number(this.contentHolder)){
loadMovieNum("content1.swf",this.contentHolder);
} else {
this.contentHolder.loadMovie("content1.swf");
[/as]
The external swf is al working fine, the preloader, buttons and thumbnails behaviour. All except for one thing: the photos wont load when i click on the thumbnails. The external SWF is a photogallery with thumbnails. The script for the small thumbnails is as following: (I placed this on the first frame inside a movie clip of a movie clip which is staged in the main timeline).
[as]
var frameNum:Number;
function photoChange(){
_root.photos.gotoAndStop("img"+frameNum);
_root.photos.fader.gotoAndPlay(2);
} btn1.onRelease = function(){
[Code] .....
View 1 Replies
Oct 21, 2009
I'm creating a small game that basically moves a movieclip around the stage using the arrow keys. I found some code on the web that worked fine but when I added it as an external class as oppose to a timeline script part of it stopped working.The script is supposed to change the appearance of the MC depending on what arrow key is pressed (this is the gotoAndStop entry in the if statement), this works fine but it is also supposed to move on the x and y but now it won't after changing to external as file. I'm stuck please see the code below.I've added the correct class name to the MC and selected the export for ActionScript, I don't get any error messages,
package{
import flash.display.MovieClip;
import flash.events.*;
[code].....
View 0 Replies
Aug 8, 2011
I'm doing a project and I faced problem with loading external swf I have main swf which load external swf which work alone but when I load it from main swfall code do not workI tried and searched for solved codes but in vain)I tried this code whick makes external swf work but the buttons in main swf disappear
tn.onPress = function() {
this._parent.loadMovie("01.swf", "input");
};
[code].....
View 4 Replies
Nov 1, 2004
Okay I have some files built in MX that use this on the main timleine:
Code:
function textLoad(filename) {
loadText = new LoadVars();
[code].....
View 9 Replies
Mar 21, 2012
I cannot seem to "convert" the loadImage into a dynamic field. I am making an mp3 player and have added a cover art portion, I can only figure out how to call a single static image.However I want to to be able to call from this image from my xml file:items[currentID].artHere is the original single static image loading code.
Actionscript Code:
var tSm:String = "easeOutElastic";var tIm:Number = 2; var imageLoader:Loader; function loadImage(Iurl:String):void
[code]....
View 2 Replies
Sep 25, 2009
First of I'm using Flash CS4 and AS 3.0 I'm trying to make a photo gallery for my website. I have the gallery all setup and made and now I need a preloader for loading my images. Right now my gallery is setup like this:
-A list of clickable thumbnails. (20 thumbnails)
-A UILoader
-You click a thumbnail and it loads an external image into the UILoader.
Actionscript: I have an array with 20 images. I have 20 different event listeners for each thumbnail.
The eventlistener looks like this:
thumbs.thumbs1.t1_btn.addEventListener(MouseEvent. CLICK, loadP1);
The function looks like this:
[Code]....
The UILoader is inside 2 moveclips because of a transition effect I have. The buttons are also 2 movieclips deep because of motion tweens.specific reason.
View 2 Replies
Aug 25, 2008
I want to rapidly load an image over and over again. Basically it's from a security camera that has a web server running. on it, and it stores the current image in a file called now.jpg. I can do this from AS2 fairly easily as I can just keep calling a loadMovie() on the image, replacing the old one. At one point, I had what looked like 15fps going with that. BUT, with AS3, I can't seem to get this going very fast at all. It takes at least a second to load each image. I am using the code attached to do this. It uses an interval to load, but could be done through other methods. I can run the video out of the security cam into a converter and bring it in USB with the Video() and Camera() classes, but that only gives me 640x480. The camera is actually able to generate 1280x1024 images, which is what I am loading with my AS2 code. So,any ideas as to rapidly load these images? The web server on the camera can display a live image by using javascript to keep loading the image. There must be a way to do it in AS3 if it can be done in AS2 and javascript.
View 4 Replies
Sep 29, 2010
I want to make a photo uploader and after uploading the photo to the server you can load all the photo's that are in a folder in kind of a library.I can load one single image because I name it in AS but I want to load the whole "images" folder so I can see all the pictures that are in it.
"This is what I got so far"
load_btn.addEventListener(MouseEvent.CLICK, LoadBox);
function LoadBox(event:MouseEvent):void { //create a Loader instancevar myImageLoader:Loader = new Loader();//create a URLRequest instance to indicate the image sourcevar myImageLocation:URLRequest = new URLRequest("url to website");// load the bitmap data from the image source in the Loader instancemyImageLoader.load(myImageLocation);//add the Loader instance to the display listaddChild (myImageLoader);
View 2 Replies
Oct 22, 2010
I have created invisible buttons which when clicked will load an image into a UILoader. When testing, an output error message comes up saying:
Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///E|/butcher1/images/cut0.jpg
I thought it might have been incorrect naming conventions or instance names but I have checked and I'm sure i've got it all right.
Could it possibly have something to do with my setup of the timeline as I have all my layers on the same line.
Should I start all over?
This is what some of the code looks like an i have done the same for the rest of the invisible buttons
this is what part of the code looks like...
cut7_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3); function fl_MouseClickHandler_3(event:MouseEvent):void{ // Start your custom code // This example code displays the words "Mouse clicked" in the Output panel. trace("cut7_btn"); probackground.iloader.source = "images/cut7.jpg"; // End your custom code}
View 16 Replies
Sep 25, 2009
I created a flash slideshow which preloads the images. After preloading the images, it proceeds to load an external flash file and then the images. The problem is, very very occasionally, it will fail to actually load the images into view, and I'll just see the preloading animation, but it might still load the external swf. Additionally, it might do the reverse, and load the images and not load the external swf.
Here is the (I think) relevant code:
function onXMLLoadComplete(e:Event):void {
// create new xml with the received data
xmlSlideshow = new XML(e.target.data);
// get total slide count
// misc xml data
[Code] .....
The live site is here: [URL]
View 5 Replies
Jan 19, 2010
Is it possible to load an image(jpg, png, gif) from another domain and manipulate the pixels? I guess when the image is downloaded/copied it is in my domain.
Using the Loader and add the content to an Image component I get an error in my debugger. I guess there are some cross domain polices at work here.
But I need to be more sure how this works before moving on. I guess, if it is not possible to load the image directly I could create a local proxy.
View 2 Replies
Aug 16, 2010
I'm using the Loader class in AS3.0 to load external images. I need to load a random image each time and I'm using a timer to load a new image after 5 seconds or so. When I load the first image,
[Code]...
The problem is that my fading routine does not work. One image loads, and the next one appears straight away when it is finished loading.
My code feels like a bit of a hack...is there a nicer way that actually works...?
View 2 Replies
Feb 13, 2009
I want to load 24 external images in 4 rows each containing 6 images. I am using the below script to load images from xml file. But this script displays all images in one single row.
Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("xmlphoto.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
[Code] .....
View 9 Replies
Sep 1, 2010
I am trying to change the images the following calls up. (Using CS4 and AS 2.0)[code]Where is the getCurrentImageName calling the image up from? or..Where is the imageProperties.link ToOpen pointing to?Honestly, I get that I could find the image in the directory and just change it out with the same name/pixel size, but I'd also like to add more images to this particular project with the same conditions.I'm probably one of those girls that knows enough to cause more damage than good, so at least point me in the right direction.
View 1 Replies
Nov 17, 2010
I have built an image/video scroller in Flash 8. It loads images and flv files from an external xml file. It allows you to scroll through the images using a left and right button. The image in the middle is clickable, and when you click on it, it loads the cooresponding flv for that image and plays the flv. It all works great, except from time to time, the video control components become unactive - they are there, but do not work. Currently, I just have the playpause button. When this happens it becomes active again at the end of the video. It seems to happen more frequently in FF than in IE. If you contact me I can give you a link to a page where this is working.
Here is the main code:
import mx.video.FLVPlayback;
var picnums;
var my_format:TextFormat = new TextFormat();
my_format.font = "Arial";
my_format.size=14;
[Code] ......
View 0 Replies
Sep 1, 2010
I'm a flash newbie and I am trying to change the images the following calls up. (Using CS4 and AS 2.0)
onClipEvent (load)
{
imageProperties = _root.getCurrentImageName(0);
[code].....
View 1 Replies