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


Similar Posts:


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

ActionScript 3.0 :: Loader Or Loader Context - Container Loads The Module From An Absolute Path

Jan 23, 2009

I have two swf files, each one almost with the same classes, the most important one is a Singleton class, each swf does "singleton.getInstance()". The diference is that one swf is like a container and the other one is like a module. So when the container loads the module from an absolute path like loader.load("file://c:/modules/module.swf") or loader.load("[URL]"), two different singletons (same class) are created

But when the container loads from a relative path like loader.load("module.swf") , just one singleton is created (that is what I want) I am just intrigued with this behavior, could someone explain me this? PD: I believe is something related to loaderContext and applicationDomain but It also appears that isn't working right. -Patricio Foieri , Vertigo Labs

View 1 Replies

ActionScript 3.0 :: Loader Event.INIT Fires But Loader.content Is Null?

May 9, 2009

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.

View 13 Replies

ActionScript 3.0 :: Game App Runs Fast In Simple Loader And Slow In Other Loader?

Apr 28, 2010

I'm feeling a bit low now as I have been suffering this for months. A simple loader loads my simple game and runs VERY FAST on even slow pcs BUT when I build this other loader, it goes quite slowly and I don't know where the app is going wrong. WHERE is the processing consumptoin coming from out of my app.

[Code]...

View 1 Replies

ActionScript 3.0 :: Loader Disappearing - Set The Dimensions Of The Loader So The External Swf Doesn't 'spill Over', The Result Is A Blank Screen?

Mar 26, 2010

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.

View 4 Replies

ActionScript 3.0 :: ADDED Event In Loader.load And Loader.loadBytes

Sep 13, 2010

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?

View 4 Replies

Actionscript 3 :: Only The Loader Images Are Being Exported In Frame 1 But The Loader Still Only Shows Up At 100%?

Apr 7, 2012

the file loads correctly but the loading screen only flashes up at the end.The only thing being exported in frame 1 is the loader image, and that is extremely small.Is it possible that there's a queue of things being loaded and the loader image is at the bottom of that queue? Since that was one of the last things added to the project

View 1 Replies

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 :: Keeping Loader Contents After Loader Removed From Memory

Aug 21, 2009

I'm loading some images with Loaders, cloning the BitmapData to a new Bitmap, and adding the Bitmap as a child of a Sprite. So far, so good. I want the Loaders I'm using to be removed by garbage collection, which they seem to be. The problem, or so it seems, is that when the Loaders are cleaned up, the Bitmaps I'm creating lose their data.

Edit: All this is happening when a class is instanced, and many copies of this class are being used as actors in a game. As the Actors are being created the older ones are losing their BitmapData to garbage cleanup. When all of them are finally loaded, only the last few are visible. I've rewritten my posted code as a class. If I prevent the Loaders from being cleaned up by somehow keeping a reference to them, the Bitmaps don't lose the data, but I don't want these Loaders hanging around.

[Code]..

View 1 Replies

Actionscript 3 :: Loader() - Loading Multiple Images With One Loader?

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

ActionScript 2.0 :: Simple Loader Fails When Loading In An .swf Containing The Loader?

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

ActionScript 3.0 :: Converting A Bitmap Loader To A MovieClip Loader?

Aug 24, 2009

how to create an image gallery that loads external bitmaps. It also has some nice fade in/fade out effects using Tweener. I was wondering, what would I need to modify from my code to load MovieClips from the library instead of the external JPEGs.

Code:
import caurina.transitions.Tweener;
var btn:Object;
var disabledBtn:Object;

[Code].....

View 8 Replies

ActionScript 3.0 :: How To Access A Loader Loaded By A Loader

Aug 13, 2009

How to access a loader loaded by a loader

View 4 Replies

ActionScript 3.0 :: Loader Class - Error 1061: "Call To A Possibly Undefined Method Load Through A Reference With Static Type Loader"

Oct 20, 2010

siteLoader.as, Line 23 1061: Call to a possibly undefined method load through a reference with static type Loader.

[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

IDE :: Relative Positioning With X AND Y?

Feb 13, 2009

I'm looking to create something like the link below, [URL].. however I need it to work on both x and y,I've been trying for days to figure out a way to pull this off,

can anyone point me to a tutorial or an example of something along those lines?

View 5 Replies

ActionScript 3.0 :: Image Viewer And Im Loading An Image To A Loader And Then Add The Loader To The Stage?

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

ActionScript 2.0 :: Positioning And Resizing A .jpg

Jul 12, 2010

I'm using action script v2 to load a .jpg from a button.I'm using the command 'loadMovieNum("photo.jpg",4)'What script could I add in to resize the jpg to specific dimensions and position it at a particular x,y coordinate?

View 2 Replies

ActionScript 3.0 :: Positioning MCs According To Height?

Aug 24, 2010

I need to create the attached jpg, but i'm not sure of the best way to tackle it. The news posts are loaded from XML and will vary in height so they need to somehow be sorted so that if one is going to come off the page, then it's put into the next page - where the user will click the scroll buttons to view.

1/ Load article from XML

2/ Create a postMC_0 and add article bits to it (date, title, body)

3/ Record height

4/ Create a newsColumn_0 and add postMC_0 to it

Then a loop:

5/ Load next article

6/ Create a postMC_1 and add article bits to it

7/ If difference between postMC_0 height and newsColumn_0 height is greater than the height of postMC_1, then add postMC_1 to newsColumn_0.

8/ If not, then create newsColumn_1 and add postMC_1 to it.

9/ Loop back to 5 (increasing the numbers each time, so postMC_2, etc) Then just make the scroll buttons function according to how many columns have been created..

View 21 Replies

ActionScript 1/2 :: Loading And Positioning A Swf Into A Swf

Sep 8, 2010

This is the swf I'm trying to load. These actions load and position a small simple swf just fine and the trace in the onLoadProgress function indicates that it loads completely but I can't see it. What am I doing wrong?

[Code]...

View 12 Replies

Flash :: Get Positioning After Rotation?

Nov 28, 2011

I built an app in flash where you can rotate objects and save positions and rotation to xml.... that xml then feeds html to produce a layout that is then rendered the a pdf It seems that every time it goes to the html, a rotated object in positioned a little to the lower right then the position in flash.

I know the rotation in css in different, but I think if I can find the true top left of the rotated object in flash and pass that it will solve the issue.

I tried this

newx = imageHolder.parent.localToGlobal(new Point(imageHolder.x,0)).x;
newy = imageHolder.parent.localToGlobal(new Point(0,imageHolder.y)).y;
also this imageHolder.parent.globalToLocal(imageHolder.localToGlobal(imageHolder.getBounds(imageHolder).topLeft));

neither work. Is there something else?

View 1 Replies

ActionScript 3.0 :: Positioning And Resizing?

Nov 27, 2010

I have been working on this to no avail. I would like to individually position different movie clips unto my flash site, yet it will only let me position one. Well.. more specifically it will perfectly position rock_mc, but transition_mc wont appear centered until I resize the screen manually. Is there any way I can fix this to have it appear in position from the beggining?

Code:
function init()
{

[code].....

View 1 Replies

ActionScript 2.0 :: Positioning Mcs On The Stage?

Aug 24, 2011

I'm trying to make some mcs be displayed from alpha 0 to 100, one by one in the stage and in random positions. I've managed to make appear it randomly from alpha 0 to 100 with this code:

Code:
mcs = new Array("mc0", "mc1", "mc2", "mc3", "mc4", "mc5");
mc0._visible = mc1._visible = mc2._visible = mc3._visible =mc4._visible =mc5._visible = false;[code]....

The strange thing is that only some mcs are positioned randomly and others stay in the same position.

View 3 Replies

ActionScript 3.0 :: Relative Positioning With X And Y?

Feb 13, 2009

I'm looking to create something like the link below,
[URL]
However I need it to work on both x and y.

View 2 Replies

ActionScript 2.0 :: Top Right Dynamic Positioning?

Mar 8, 2007

how would you go about positioning a MC in the top right hand corner - a few pixels. And How to get it to stay even on Resize? to get it to stay in that corner so it moves with the screen resize?

View 2 Replies

ActionScript 2.0 :: Positioning MCs And Textfields?

May 1, 2007

Here's my code:

Code:
for (var i = 0; i<nTotalPics; i++) {
main.createEmptyMovieClip( "container"+i, i );
var container:MovieClip = main["container"+i];
container.createEmptyMovieClip( "pic"+i, i );

[code]....

First, if I add "trace (pic._name);" inside the onLoadInit function it outputs "pic3,pic2,pic1,pic0". Why does it show up in reverse order of the for-loop?

Second, is the "pic:MovieClip" in "mclListener.onLoadInit = function(pic:MovieClip)" pointing to the "pic" in "mcl.loadClip( astrImages[i], pic );"? If not, what is it pointing to? If it is, can I add another variable after "pic" so that I can pass it inside the onLoadInit function? Ultimately what I would like to do is create a textfield under each pic.

View 1 Replies

ActionScript 2.0 :: Positioning Mcs On The Y Axis

Nov 20, 2008

I am using this actionscript to obtain full screen flash in AS2 but am having problems positioning mcs on the y axis (the x is no problem).

[Code]...

I am trying to get the mc "buttons" position in the top right of the browser window but I cant get the height value correct. When the width is used on its own it works perfectly.

View 2 Replies

IDE :: Positioning The Movie Clips?

Jan 16, 2009

I have five rectangle shaped movie clips....I need to change their _y position randomly by clciking a button..but there must be 10px space between them... so how do I modify the code to do it ?

PHP Code:

myArray = new Array(m1, m2, m3, m4, m5);for (i=0; i<=myArray.length; i++) {_root["m"+i]._x=400;_root["m"+i]._y=Math.floor(Math.random()*300)+20;} 

View 6 Replies

ActionScript 2.0 :: Positioning Mc At Fullscreen

Feb 1, 2009

i have seen websites with fullscreen .swf and i dont know what kind of script they used to have the movie clips positioned constantly i.e. 20px from right border of the screen while all people have different resolutions.

View 2 Replies







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