IDE :: Positioning Loader, XML, Swfs, Gallery?

May 20, 2009

This is driving me crazy. When I preview in Flash, everything looks fine. When I preview in HTML. Not so much. I've created a gallery using xml and have the code centering (and otherwise positioning) each new loaded item by referencing each ones information.

It seems to have trouble doing this with the first swf and positioning it at 0,0 after I click through the forward/back buttons that swf moves to a different location on the stage. My guess is that the loader height and width get calculated as 0,0 before the image gets loaded, and then screws everything up from there.

import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.LoaderInfo;

[code]....

View 3 Replies


Similar Posts:


ActionScript 3.0 :: When Loader.swf Loads The RSL And The Other 10 Swfs The Loader Throws Errors?

Aug 12, 2009

i have a main loader swf file called loader.swf and it loads an RSL.swf (runtime shared library for my swf files) and then 10 swf files, each one to a container (fE.: movieclip '01' in loader.swf, then movieclip '02' and so on). the 10 swf files have a lot of references to RSL.swf, and i have to use RSL.the problem is when loader.swf loads the RSL and the other 10 swfs the loader throws errors like this:

Code:
*** Security Sandbox Violation ***[code]...

then i put in EVERY swf files (loader,RSL and the other 10) the code Security.allowDomain ("*") but throws the same errors...

View 1 Replies

ActionScript 3.0 :: Positioning Loader For Swf?

Mar 9, 2009

I am trying to position my loader for an external swf. Can anyone help me. Here is the code that I currently have to load the swf. These are the positions that I need x=0, y=180.

Code:

stop();
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadComplete);
function swfLoadComplete(loadEvent:Event)

[code]...

View 2 Replies

ActionScript 3.0 :: Load External SWFs, AddChild(Loader) Versus AddChild(Loader.content), Etc?

Jul 29, 2009

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?

View 7 Replies

ActionScript 3.0 :: Add And Remove Swfs With UI Loader?

Nov 9, 2009

I have a flash file with frame labels, home, profile, contact.it also has 4 separate photogalleries, gal1, gal2, gal3, gal4 also in frame labels. the galleries are all separate swf files. I used the UI loader and added gal1.swf and 3 more separate loaders for the rest of the galleries. What happens is after you select the first gallery the mouse becomes invisible because the loader is still on the stage. How do I remove the loader from the stage each time I use a button?

View 3 Replies

ActionScript 3.0 :: Replacing Swfs In Loader?

Jun 24, 2009

Im moving up from as2 and want to use buttons as shown in the code below. How do I empty holding container though eg "holder1" in this case.Here is Code:

import fl.transitions.Tween;
import fl.transitions.easing.*;
surr_mc.addEventListener(MouseEvent.CLICK, slideshow);

[code]....

View 0 Replies

ActionScript 3.0 :: Reload Loader With Different Swfs

Aug 14, 2009

I am having issues with this code, and I really cant figure out why. I am building a portfolio gallery, with one loader who loads 5 different .swf which load XML files. Everything work, but once I unloaded it to reload it, it says that its loaded but I dont see anything anymore... I probably tried a 1000 versions, but here is my latest code: Load the first gallery

[Code]....

View 0 Replies

ActionScript 3.0 :: Loader Won't ConstructChildren() On Some SWFs?

Oct 7, 2009

I'm getting this sort of error while trying to load SWF's inside another swf (using the Loader)

ReferenceError: Error #1056: Cannot create property stageTitleLabel on Main.
at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at Main$iinit()

I've kinda tracked down the issue to not having "Declare Stage Instances Automatically" checked, as I am declaring the stage instances in the code, so that the code will compile in Flash Develop as well as the IDE (i.e. in the flex compilor as wel as the IDE)

[Code]...

View 3 Replies

Actionscript 3.0 :: Pre Loader For External Swfs?

Aug 23, 2010

I am using the below code to load in external swfs. I normally put the preloader in the external swf but that does not work with this code. I therefore need to put the preloader in this swf. All the preloader need to be is the numbers (1-100).

Code: Select all/
/EXTERNAL SWF LOADER
var loader:Loader= new Loader();

[code].....

View 3 Replies

ActionScript 3.0 :: Using The Loader To Load Swfs In Different Levels

Jul 24, 2010

as you can see it loads an new swf on top of my main. I did not relaize that because of a dropdown menu in the main.swf evrytime I load another swf on top ie obscures the dropdown. besides putting the dropdown in each swf and removing it from the main which would be the obvious, I wanted to avoid this as the loded swfs will have slideshow pro videos which will be a bit heavy.

[Code]...

View 4 Replies

ActionScript 2.0 :: Mc Loader And Swfs Loading And Position?

Oct 4, 2006

Here is the thing : on rollover on thumbnails ( buttons)its preview has to appear on the top of it.My corrected code works fine exepted that my swf don't load in a good way..they load at 60 kms from the thumbnail...and in a distorted size!I don't get it.I turn the thing in all ways but it is getting worth...What is my mistake?Code for each button ( thumb)

on (rollOver) {
_root.caption._visible = 1;
_root.caption.image_mc.loadMovie("images.swf");

[code].....

View 1 Replies

ActionScript 3.0 :: Loader Class - Best Solution For Communication Between SWFs?

Mar 18, 2009

I want to ' import ' or ' download ' some SWF file into my main-swf file. I then want them to do a lot of communication back and forth. The best would be if I could just call functions from the new SWF file from my main-swf file, or the other way around. Do I use the loader class? And do I use the .parent.parent thing? Or is there a better solution?

View 3 Replies

Flash :: Unloading Swfs Loaded With Loader::load()?

Jan 23, 2010

I'm using Loader::load() successfully to load swfs into my main swf and then I add them as a child of a Sprite. When other events occur I want to remove the swfs as needed. I have looked at unload() and at removeChildAt() without success.

I only added the addChild() call to try to pin down the loaded instance so I could remove it. The loading works fine without the addChild();

I have also tried publishing to player v.10 and using myLoader.unloadAndStop(); but this has no effect either;

The following demo code shows my problem. I see one child added and one removed but intro.swf is still playing away.

import flash.display.Loader;
import flash.display.Sprite;
import flash.display.LoaderInfo;

[Code].....

View 1 Replies

ActionScript 3.0 :: Loading SWFs Into Same Loader And Removed From Stage?

Jan 4, 2009

I was told that if you load a new SWF into a loader that has an existing SWF that the second SWF will replace the object(the first SWF) in the loader and in the display list.Does this mean that the first SWF is removed from the stage once the second SWF is loaded? I am asking because I would like to know if my this.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler1); in the first SWF will fire once the second SWF is loaded.

View 3 Replies

ActionScript 3.0 :: Relative Paths And Swfs Opened With Loader?

Feb 12, 2009

Relative paths with Loader seems to be different than with loadMovie. How do I access the main movie's (mov_a) functions from the loaded movie (mov_b)? I tried using mov_b's parent and root but neither worked.

For the sake of clarity, this is mov_a's code:

[Code]...

View 1 Replies

Actionscript 3.0 :: Using Loader With Document Class Compiled Swfs

Aug 25, 2009

I know that typically, a loader class normally can load in either a swf or an image file (like a jpeg), but there were some swf files that just would not load for some odd reason. So I decided to do some trial and error tests and discovered that the problem was coming from swfs that were compiled from flex.

At this point I decided to try a different approach and compile from flash instead using the .as file as a document class in a blank fla. I received the same effect of it not being loaded. It could not have possibly been a coding problem with the swfs compiled from flex; they were working fine on release-builds.

I've come to the conclusion that the problem is not with flex or flash, but just compiling swf from a document class. I did more research into the problem, and I only found that document class compiled swfs have only 2 frames (first one being the preloader, and the second being everything else). They had some example codes on using the loader class with these swfs, but the code only demonstrates with traces when its loaded; they don't actually explain or show how to make the swf viewable the way it should.

[Code].....

View 1 Replies

ActionScript 3.0 :: Loading SWFs Into Same Loader And Removed From Stage

Feb 16, 2011

I was told that if you load a new SWF into a loader that has an existing SWF that the second SWF will replace the object(the first SWF) in the loader and in the display list.

Does this mean that the first SWF is removed from the stage once the second SWF is loaded? I am asking because I would like to know if my this.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler1); in the first SWF will fire once the second SWF is loaded.

View 0 Replies

ActionScript 3.0 :: Loader Class To Load In Multiple External SWFs?

Mar 9, 2009

In AS3 i am using the Loader class to load in multiple external SWFs (AVM1), each of which has a short animation which automatically plays when the swf is I obviously cannot control the timeline of these (i can't use local connection etc) but would like to load in the *.swf files, so they're in memory then add them to the stage when requested. the problem is that if i load them enmass. then use addChild when they are called, they have already played through and animated pre the addChild command.

(I cannot edit the swfs at all, and would rather not load them on demand at runtime)

View 5 Replies

ActionScript 3.0 :: Load And Replace Random Swfs Into Same Loader On Stage?

Jun 28, 2009

for some reason escapes me: using AS3 how can a swf load another swf to replace itself in the same loader on the stage, while simultaneously calling a randomizing function in the first frame of the main timeline, to randomize the next swf?At the end of each swf (called "koan_#.swf") there is the following old AS2 code...it was used to randomly select and then play a swf from koan array:

_root.index++
if(_root.index>_root.koan.length-1){
_root.index=0;

[code].....

View 5 Replies

ActionScript 3.0 :: Verifyerror Breaks Loader - Swfs (Error #1014)

Jul 23, 2010

I've got a main swf that loads several extensions as swfs, these swfs share code, and when I've updated the main loading an extension might generate a VerifyError because of missing/changed classes -- I really want to handle that situation gracefully as I don't always have control over the extensions 'out there'.

Apparently one VerifyError (Error #1014) breaks the whole loading system preventing other swfs to be loaded. (They do in fact load - I'm seeing the request and the debug player reports the data as loaded, and the urlloader works as well, but the swf is never initialized and I don't get a COMPLETE event) Does anyone know how I can make flash survive a VerifyError? I'm both interested in ways to know a verifyerror happened and in ways to keep flash going after the error.

View 8 Replies

ActionScript 3.0 :: Make A Banner Loader - Swfs Continuously - Looping

Jul 18, 2011

I want to make a banner loader. Basically its a swf that must load other swfs continuously, looping. Ive tried 2 things this far, and none of them seemed to work. 1st try: on my banner1.swf I used the onComplete parameter of Caurina package. So, when the animation should end, I simply made a method stating something like this:

[Code]...

View 1 Replies

ActionScript 3.0 :: Flex 1 Swf Loader, Multiple Swfs Importing From Shared Library?

Dec 15, 2009

I'm using Flex builder 3 for my main application (web-based), and I need to load multiple swf files built in flash cs4 (AS3) at different times. The flash swfs import assets from a separate flash swf used as a shared library. I'm using 1 swf loader in flex to keep 1 flash swf loaded at a time.Loading the first swf works fine, but loading subsequent swfs generates an error in importing from the shared library swf.

Here's an example of an error:

"ReferenceError: Error #1065: Variable sharedApps is not defined."

View 3 Replies

ActionScript 3.0 :: Pre Loader Into Gallery?

Oct 1, 2011

I'm making a flash gallery with a pre loader on the first frame and on the second frame is the content.
 
The pre loader works, and loads up my first gallery image but then I can not proceed to view any more when I click my gallery buttons. Previously without the pre loader the buttons worked fine.

[Code]...

View 1 Replies

ActionScript 3.0 :: XML Loader - Dynamic Image Gallery

Oct 14, 2008

I'm trying to do a gallery with an XML file. My XML file is organized like that :

<images>
<image chemin="images/Palmares.jpg" titre="Palmares"
commentaire="Chamonix" />
</images>

The picture loader is working well and the text too but it doesn't work so well together. When I'm clicking on a sticker, the picture is load and a text too but it's not the good one.

View 6 Replies

ActionScript 3.0 :: XML Gallery Using Greensock Loader Class?

Jun 28, 2011

I am finding my way with AS3 but am having difficulty with a gallery project I am trying to put together based on the sample slideshow available on this site.

The problem relates to reading the thumb and image paths in the xml file. The error that is coming back is:

Loading error on ImageLoader 'loader1' (assets/thumbs/): Error #2035: URL Not Found. URL: file:///C|/Documents%20and%20Settings/Alistair.HOME/Desktop/AB%20gallery%20proj/assets/thumbs/

[Code].....

View 1 Replies

ActionScript 3.0 :: XML Gallery Sorting With Loader Class?

Sep 26, 2009

I'm reasonably new to AS3 having made the leap from Flash 8 to CS4 in a single bound. I've been doing okay, but I've stumbled across a bit of an issue:I'm using an XML file to load a gallery of images and information, where a node typically looks like this:

PHP Code:

 <project>  <image>1.jpg</image>   <link>gallery-1</link> - <title>- <![CDATA[ This is image number 1]]>   </title>- <info>- <![CDATA[ Lorem ipsum dolor sit amet, consectetaur adipisicing elit. ]]>   </info>  </project>- <project> 

In AS, once my XML has been parsed, it runs this function:

[AS]
var projectTitles:Array = new Array();
function createProjectClips(list:XMLList):void {

[code]....

This all works fine; I need all of these thumbs loaded and parsed at the same time to show the full gallery. The issue is that, as the images are of varying file sizes they don't load in sequence, and because I can't pass additional parameters through the eventListener, I've apparently got no way to organise the images on screen. So, my images on screen might be in the sequence 1.jpg, 4.jpg, 3.jpg, 2.jpg, but my projectTitles array will say Image 1, Image 2, Image 3, Image 4.

View 6 Replies

ActionScript 3.0 :: Adding A Pre Loader To An XML Photo Gallery Between The Photos?

Feb 15, 2010

I have made a photogallery in actionscript 3 which uses an .XML file to import pictures. As the user clicks on the displayed image the code loads the next image in the cycle into the display. Now, I would like to add a preloader which displays the loading progress of each image as the user clicks (otherwise there is just a blank area as the image loads). I have made a pre-loader for the main .SWF but I can't figure out how to make it work for the images or how to make a seperate one for the images. The fact is that I am a bit of a muppet when it comes to AS3, and am finding myself getting lost an confused quite easily.

I have attatched the .FLA if that helps any! If not then...

here is the link to the .HTML page that contains the .swf:

[Code]...

View 2 Replies

Professional :: Add A Loader To An Image Gallery Loading Content Using Only Actionscript

Jul 26, 2010

i am loading all thumbs and  images in a container on a single frame using action script..but the  size of the swf becomes 1.2 mb so i want to add a loader to it...the  loader i am trying to add counts the frames but my file has just one  frame so the loader doesnot show up..

here is the script of my  gallery..and the timeline has just one frame...

import mx.transitions.Tween;import  mx.transitions.easing.*;
this.createEmptyMovieClip("container",1);var  imagesNumber:Number = 18;var scrolling:Boolean = true;
for (i=1;  i<=imagesNumber; i++) {container.attachMovie("thumb"+i,"thumb"+i+"_mc",i);myThumb_mc  = container["thumb"+i+"_mc"];if (i==1){    myThumb_mc._x =  (0.0)*myThumb_mc._width;

[Code].....

View 1 Replies

Flash :: Can't Remove All Loaded Children In A Gallery Because Can't Close() A Loader?

Jun 15, 2011

My problems comes in when you have to open a different image album and have to eliminate all the previously loaded children in the movieclip. When i load a new album i used a code you posted here: AS3 How to remove previous loadersbut the problem is that sometimes the user leaves the album page before ALL the pics laod so when they click on a new album to open it a new image is placed somewhere else cause the loader has already been launched. I've tryd to close() the loader but it doesn't seem to work.Here you can see the working site to see what im talking abouy you have to click on an album, leave before all the pictures load and open up another one.

getImage(dataList[0].file)
function getImage(href:String):void {
var loader:Loader = new Loader();

[code].....

View 3 Replies

ActionScript 3.0 :: Sliding Thumbnail Gallery - Loader Content Drag

Jul 28, 2010

I have a sliding thumbnail gallery which when a thumbnail is clicked loads an external .png into a container with an instance name of mycontainer which I have on the stage in the .fla. Its added like such:
When the Loader's (which I gave an instance name of imgLoader) complete event is called the function onLoaded loads it -like this: mycontainer.addChild(imgLoader);

I also added a mask(stageMask2) to mycontainer which is the same size as the external .png--I then used this code imgLoader.mask=stageMask2; to mask the .png. I did this because I added a zoommc function which enlarges the imgLoader and wanted to keep the visible size of the container the same. I would also like to be able to drag the zoomed image. I don't want to drag mycontainer as it contains the mask and I cant drag the imgLoader as it doesn't have that property--Do I need to put the imgLoader in another container?

Here's the problematic code:
var stageMask2:Sprite = new Sprite();
stageMask2.graphics.beginFill(0x183045,0);
stageMask2.graphics.drawRect(swfX,swfY,604,403);
stageMask2.graphics.endFill();
var closeWin:TextField=new TextField();
[Code] .....

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved