Loading an External Gallery
I have a website created all in Flash AS3 and I have a XML Photo Gallery created in a separate file and I am trying to load the gallery into a specific frame on my site. I have tried a few things but I haven't been able to figure it out so someone's help would be much obliged. Thanks in advance!
EDIT:
Here is the code I am using:
var Xpos:Number = 152;
var Ypos:Number = 350;
var swf:MovieClip;
var loader:Loader = new Loader();
var gallerySWF:URLRequest = new URLRequest("GraphicsGallery/Ggallery.swf");
loader.load(gallerySWF);
loader.x=Xpos;
loader.y=Ypos;
addChild(loader);
When I have the XML file in the same folder as the gallery (which it has to be) Flash gives me an error and the gallery doesn't show up. When I move the XML file though the gallery itself loads into the correct spot but the pictures don't because the XML file isnt there to call them.
This is the error it gives me when the XML is in the same file as the gallery:
"Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///ANTHONY/Portfolio/Ggallery.xml
at Ggallery_fla::MainTimeline/frame1()"
ok so i fixed the problem i simply got rid of the extra folder so now it's a little messier but ill deal. I have another easier question though. Since it might be easier for you to see the problem yourself you can go see the site here: http://www.anthonymorones.com/
If you click on the Graphics page you can see that the gallery shows up but if you click away on to a different page then the gallery doesn't go away. I know that it is a simple problem but I can't seem to figure out how to fix it.
And my last problem with the gallery, if you click on one of the smaller images it gets bigger but the larger one isn't centered to where it's supposed to be, so if you know how to fix that it would be great.
Here is the code for the gallery:
import fl.controls.ProgressBar;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var columns:Number;
var my_x:Number;
var my_y:Number;
var my_thumb_width:Number;
var my_thumb_height:Number;
var my_images:XMLList;
var my_total:Number;
var container_mc:MovieClip;
var preloaders_mc:MovieClip;
var full_mc:MovieClip;
var x_counter:Number = 0;
var y_counter:Number = 0;
var my_tweens:Array = [];
var container_mc_tween:Tween;
var full_tween:Tween;
var myXMLLoader:URLLoader = new URLLoader();
myXMLLoader.load(new URLRequest("Ggallery.xml"));
myXMLLoader.addEventListener(Event.COMPLETE, processXML);
function processXML (e:Event):void{
var myXML:XML = new XML(e.target.data);
columns = myXML.@COLUMNS;
my_x = myXML.@XPOSITION;
my_y = myXML.@YPOSITION;
my_thumb_width = myXML.@WIDTH;
my_thumb_height = myXML.@HEIGHT;
my_images = myXML.IMAGE;
my_total = my_images.length();
createContainer();
callThumbs();
myXMLLoader.removeEventListener(Event.COMPLETE, processXML);
myXMLLoader = null;
function createContainer():void{
container_mc = new MovieClip();
container_mc.x = my_x;
container_mc.y = my_y;
addChild(container_mc);
container_mc.addEventListener(MouseEvent.CLICK, callFull);
container_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);
container_mc.buttonMode = true;
preloaders_mc = new MovieClip();
preloaders_mc.x = container_mc.x;
preloaders_mc.y = container_mc.y;
addChild(preloaders_mc);
function callThumbs():void{
for (var i:Number = 0; i < my_total; i++){
var thumb_url = my_images[i].@THUMB;;
var thumb_loader = new Loader();
thumb_loader.load(new URLRequest(thumb_url));
thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
thumb_loader.name = i;
thumb_loader.x = (my_thumb_width+10)*x_counter;
thumb_loader.y = (my_thumb_height+10)*y_counter;
if (x_counter+1 < columns){
x_counter++;
} else {
x_counter = 0;
y_counter++;
var preloader_pb:ProgressBar = new ProgressBar();
preloader_pb.source = thumb_loader.contentLoaderInfo;
preloader_pb.x = thumb_loader.x;
preloader_pb.y = thumb_loader.y;
preloader_pb.width = my_thumb_width;
preloader_pb.height = my_thumb_height;
preloaders_mc.addChild(preloader_pb);
preloader_pb.addEventListener(Event.COMPLETE, donePb);
function thumbLoaded(e:Event):void {
var my_thumb:Loader = Loader(e.target.loader);
container_mc.addChild(my_thumb);
my_tweens[Number(my_thumb.name)]=new Tween(my_thumb, "alpha", Strong.easeIn, 0,1,0.5, true);
my_thumb.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded);
function callFull(e:MouseEvent):void{
var full_loader:Loader = new Loader();
var full_url = my_images[e.target.name].@FULL;
full_loader.load(new URLRequest(full_url));
full_loader.contentLoaderInfo.addEventListener(Event.INIT, fullLoaded);
var full_pb:ProgressBar = new ProgressBar();
full_pb.source = full_loader.contentLoaderInfo;
full_pb.x = (stage.stageWidth - full_pb.width)/2;
full_pb.y = (stage.stageHeight - full_pb.height)/2;
preloaders_mc.addChild(full_pb);
full_pb.addEventListener(Event.COMPLETE, donePb);
container_mc.removeEventListener(MouseEvent.CLICK, callFull);
container_mc.buttonMode = false;
container_mc.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.removeEventListener(MouseEvent.MOUSE_OUT, onOut);
new Tween(container_mc, "alpha", Strong.easeIn, 1,0.5,0.5, true);
container_mc_tween = new Tween(container_mc, "alpha", Strong.easeIn, 1,0.5,0.5, true);
function fullLoaded(e:Event):void{
full_mc = new MovieClip();
full_mc.buttonMode = true;
addChild (full_mc);
var my_loader:Loader = Loader(e.target.loader);
full_mc.addChild(my_loader);
full_tween = new Tween(my_loader, "alpha", Strong.easeIn, 0,1,0.5, true);
my_loader.x = (stage.stageWidth - my_loader.width)/2;
my_loader.y = (stage.stageHeight - my_loader.height)/2;
my_loader.addEventListener(MouseEvent.CLICK,removeFull);
my_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, fullLoaded);
function removeFull(e:MouseEvent):void{
var my_loader:Loader = Loader (e.currentTarget);
full_tween = new Tween(my_loader, "alpha", Strong.easeOut, 1,0,0.5, true);
full_tween.addEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
container_mc_tween = new Tween(container_mc, "alpha", Strong.easeOut, 0.5,1,0.5, true);
function donePb (e:Event):void{
var my_pb:ProgressBar = ProgressBar(e.target);
preloaders_mc.removeChild(my_pb);
my_pb.removeEventListener(Event.COMPLETE, donePb);
function tweenFinished (e:TweenEvent):void{
var my_loader:Loader = Loader (e.target.obj);
my_loader.unload();
full_mc.removeChild(my_loader);
removeChild(full_mc);
full_mc = null;
container_mc.addEventListener(MouseEvent.CLICK, callFull);
container_mc.buttonMode = true;
container_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);
var my_tween:Tween = Tween(e.target);
my_tween.removeEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
function onOver (e:MouseEvent):void{
var my_thumb:Loader = Loader(e.target);
my_thumb.alpha = 0.5;
function onOut (e:MouseEvent):void{
var my_thumb:Loader = Loader (e.target);
my_thumb.alpha = 1;
and here is the part of the XML file that is supposed to control that:
<GALLERY COLUMNS="5" XPOSITION="30" YPOSITION="30" WIDTH="100" HEIGHT="155">
Thanks for your help!
Similar Messages
-
Load an external gallery file into a host div via Ajax method?
I was just wondering if anyone has been able to get a spry
gallery to work when placed within an external html file and loaded
into the host div of a page using Ajax method to load. It must work
remotely (on the Internet).
I've tried and mutilated enough sample files, that I'm
continuing my work in Flash and don't have anything un-mutilated to
post at this moment.
If you have, great. Let me know. If you have a link somewhere
it has been done correctly that I can look into and are willing to
post the link, I'd be glad to see it working.
thanx.I am not calling any scripts from an outside server. All of
the external htm files I am pulling are located within the site
root (or in a sub folder of).
What I am trying to do is have two Spry gallery slideshows
(very similar to the demo) coded on separate htm pages that are
brought into divs of the index file (main file).
I have a spry tabbed panels widget. The content for each of
the "TabbedPanelsContent" divs are in external htm files. The
external files that contain basic text, images, and links work
beautifully. The files that have Spry Gallery slideshows in them do
not display properly.
The experimental files I've created are in major disarray
because I've added other issues to test. When I can return to it
and prepare a new troubleshooting file, I will post a link if I
haven't resolved it. -- or the solution if I find it. Mainly I was
wondering if anyone had created something similar so I could
inspect the code to compare.
Thank you for replying Cristian! -
Loading an external .swf then referencing to it's label
I'm new with Actionscript and am currently working at
building a website. I've got a lot figured out so far but one
problem I'm running into is when I try to load an external .swf
using the loader component and then reference it or try to point to
it within my main .swf I can only load the "gallery.swf." through
myLoader.contentPath = "gallery.swf";
I'm trying to load it and then point to a specific label so
it loads that frame or label. I've created separate labels for each
image in my gallery so that when I point to them with AS, it knows
which image to load. It worked when I had the gallery in the main
.swf but when I used the loader component it didn't work.
The AS I used that worked before I made a separate .swf and
used a loader was:
on(release) {
_parent._parent._parent.photos_MC.gotoAndPlay("img1");
what I thought would work was:
on(release){
_parent._parent._parent.myLoader.contentPath =
gallery.swf.photos_MC.gotoAndPlay("img1");
I'm probably totally off, but if anyone could help out I
would appreciate it!This looks like AS2 code, you may want to post there.
Assuming this is AS2 code, the contentPath of the Loader specifies
the url to load. Once the swf is loaded, you can then gotoAndPlay()
to the label you want.
Hope that helps. -
how to load an external using a loader to show while its loading...my swf which is to be loaded is a gallery having jus one frame on which action script is placed..
hi 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;
else
myThumb_mc._x = ((1.2*i)-1.2)*myThumb_mc._width;
myThumb_mc._y = (Stage.height-myThumb_mc._height)/2;
myThumb_mc._alpha = 100;
myThumb_mc.largerImage = i;
myThumb_mc.onRollOver = function() {
this._alpha = 60;
myThumb_mc.onRollOut = function() {
this._alpha = 100;
myThumb_mc.onRelease = function() {
this._alpha=100;
for (i=1; i<=imagesNumber; i++) {
var myClip = container["thumb"+i+"_mc"];
myClip.enabled = false;
scrolling = false;
_root.attachMovie("image"+this.largerImage,"large_mc",2);
large_mc._x = (Stage.width-large_mc._width)/2;
large_mc._y = (Stage.height-large_mc._height)/2;
new Tween(large_mc, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
new Tween(container,"_alpha",Strong.easeOut,100,50,0.5,true);
large_mc.onRelease = function() {
scrolling = true;
var myFadeOut = new Tween(large_mc, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
new Tween(container,"_alpha",Strong.easeOut,50,100,0.5,true);
myFadeOut.onMotionFinished = function() {
for (i=1; i<=imagesNumber; i++) {
var myClip = container["thumb"+i+"_mc"];
myClip.enabled = true;
large_mc.removeMovieClip();
container.onEnterFrame = function() {
if (scrolling){
this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*20;
if (this._x>0) {
this._x = 0;
if (-this._x>(this._width-Stage.width)) {
this._x = -(this._width-Stage.width);
anyone knows how to add a loadre to this...?
thanks.. -
AS2 mc loads 1 external swf from group depending on cookies and .html location
I am attempting to load an external swf banner into an empty movieclip (main.fla for argument), which seems straightforward enough. But the idea is that each .swf (banner) is a link to its own respective html page. I.E. bannerA.swf links to pageA.html etc.
The first problem is that I dont want main.fla to display bannerA.swf on pageA.html since the user will already be on pageA. So I need main.fla to recognize the .html page that the user is currently on (I have to do this in one flash file, otherwise I would make 4 which exclude the banner for its own page– though, if this would greatly reduce headache, I might be able to talk the powers that be into it).
Secondly, I need main.fla to remember which banner (or banners) the user has seen on previous visits to a page so that the banners will rotate with each consecutive visit.
Im guessing this can be implemented with an array and some listeners, but Im no AS2 guru. Any help would be more than appreciated.
Thank You,
RyanOh, I know I am sorry about that! I have been fiddling around
and updating that version... I changed it to be a pop-up after I
posted the question because in the forum for where I purchased the
main layout template, a lot of people had written in saying that
they could not get any gallery features to work with the buttons...
so its something in the main page code, I don't know what.. but I
am a bit eager to get the site up so I reverted to a pop-up for
now... -
My basic question is: "What are the classes which we should not use for iOS using the packager."
I have been trying for a few days trying to get a simple Flash app to run on the iPad. A very simple app (with sound!) with just 2 classes works fine (Performance is a whole other issue. We will get to that). But if I try anything else, all I get is a white/black screen on the iPad. So it would be really nice to know what classes, functions, etc we CANNOT use for the Packager.
I have fairly simple app (not as simple as 2 classes) which loads some art assets via URLRequest/Loader, puts them on the stage. Fairly common standard practice in AS3.
I've read about not able to load an external file using the Packager. So to fix the situation of loading assets, I have looked into the [embed] tag, which seems to work. I hope the blogger doesn't mind, but this page is an excellent source on what works and doesn't work with the [embed] tag in it's various flavors: http://www.richardleggett.co.uk/blog/index.php/2010/03/08/flash_builder_and_flash_pro_asse t_workflows. For example, AS3 in a swf is stripped out from an external swf using [embed].
The best way to load an external swf file for iOS seems to be using [embed] with "application/octet-stream" and load the swf through ByteArray (Option #4 in the link above). This works great on the PC. HOWEVER, on iPad, it fails. The [embed] tag works on the iPad with the other ways, so my guess is that loadBytes() does not work. Is this true Adobe/Flash guys? Can you confirm this?
My initial question is "why is this not allowed on iOS?". If it is because of the fact that it uses a Loader, can it be changed so it's not using a Loader to construct a MovieClip? I have a ByteArray with the raw swf/MovieClip data. Why can't I construct a MovieClip from it without going through Loader?
This loadBytes() failure seems to be the only thing preventing me from using the normal pipeline of Flash development in loading external assets. If there are other ways people have found, please share!
Now on to performance. Adobe, can you post some examples/samples of code which runs at decent performance? Like a "tech demo" of what is possible using the Packager running on iPad/iPhone. That would be extremely helpful for everyone. I have done a lot of the optimizing suggestions on various sites and pages ( and by Adobe http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html), but I am not seeing the 30 fps performance that is MORE than possible on iPhone/iPad. Displaying and moving around Bitmaps (I don't use any vector graphics) should be blazing fast. Quake runs on iPad without any problems and that code is 10 years old. Moore's law dictates that drawing Bitmaps using CPU should be faster than a 3D engine written 10 years ago... I am trying out the new iOS 4.2 which is supposed to be "significantly" better, but I am still stuck on loadBytes().
So at this point, I am blocked on loadBytes() and my performance for a simple app which draws a few Bitmaps and MovieClips is terrible. I am hopeful some people out there have figured out some solution (there are lots of clever people out there) and I will stumble on to something. But being forced to go native Objective-C seems to be my only option at this point.
In summary, here are the questions I would like to ask the Adobe/Flash group for some more help/information/advise:
- Why is Loader not allowed on iOS? Is it a technical limitation of the hardware/os/Flash? Will it never be supported? What is the future of this class on iOS?
- Why is loadBytes() not allowed on iOS? I have the raw embedded data in memory. I don't need to make a remote call so security should not be an issue. Can I create a MovieClip without using Loader?
- Why is AS3 stripped from the timeline when a Symbol is retrieved using [embed]? Maybe this is the same reason loadBytes() fails, but if I could use [embed] and get a copy of the Symbol, that is what I need. (There are issues with the mx.core.MovieClipLoaderAsset/Asset, but it is better than being blocked by loadBytes())
- What are some apps you guys have written that we can use to compare PC vs iOS? Again, a "tech demo" or sample code of what you as experts in Packager for iOS have done which runs at decent framerate (30+fps) would be of tremendous help. If the Adobe/Flash group hasn't gotten the current Packager for iOS to handle more than 50+ 2D Bitmaps on screen running at 30+fps, that would be good to know. Please let us know what the experts and owners of your software are capable of getting the most throughput using the Packager. I'd hate to sound a bit fed up/angry, but I think you are wasting a lot of people's time and energy with a piece of software that, to me, seems like it was a bit early to release. Flash can do some great things. If it can do it on iOS, even better. But PROVE it to us that it's possible, before having your customers run into barriers imposed on us by trial and error.
Thanks.I have hardly ever seen a post here from someone at Adobe, so you may need to be patient.
Read this article, and get its associated demo files, to see some good performing tech demos:
http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
Back to your main point, loaders are working, what isn't working for you is accessing of things in the library of a successfully loaded swf, that have been set to Export for ActionScript. That means that the swf you have loaded has an ActionScript Class, to represent the library symbol. iOS Flash apps are native ARM code, and don't include the virtual machines that a browser plugin has, and so it's not able to interpret ActionScript. That may be why it would fail.
Now, I can think of at least a couple of reasons why you might want to have external swfs with elements that you want to reuse in the main swf. One would be if you're intending to make a lot of them, like say if you wanted to have an Asteroids game and the ability to use artwork from a set of different swfs. Another reason might be if you want to skin your interface, by taking specific elements from the loaded swf and using them in the main swf. That way you could have artists preparing those swfs for you, and you just include them in your package, and load the one you want.
There is a way to do either of those things. The second one can be done by having the item as a named symbol on the stage of the loaded swf. With a to-be-loaded swf named "inner.swf", that has a movieclip on its stage named "mc1", this script in the main swf would load that external swf and use its symbol on the main swf's stage, without having to make the inner swf's symbol use ActionScript:
var req:URLRequest = new URLRequest("inner.swf");
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
ldr.load(req);
function loaded(e:Event) {
var mc:MovieClip = e.target.content as MovieClip;
var innermc:* = mc.mc1;
innermc.x = 50;
innermc.y = 50;
addChild(innermc);
For the other case, you can take the item off the stage of the loaded swf and draw it into a bitmapdata, and then make as many bitmaps from that as you like. Here's the above example, only it adds the original movieclip to the main swf stage, and also creates a bitmap that looks the same:
var req:URLRequest = new URLRequest("inner.swf");
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
ldr.load(req);
function loaded(e:Event) {
var mc:MovieClip = e.target.content as MovieClip;
var innermc:* = mc.mc1;
innermc.x = 50;
innermc.y = 50;
addChild(innermc);
var bmd:BitmapData = new BitmapData(innermc.width,innermc.height);
bmd.draw(innermc);
var bm:Bitmap = new Bitmap(bmd);
bm.x = 150;
bm.y = 150;
addChild(bm);
So, the thing to learn is that a native ARM code application does not have an ActionScript interpreter in it, and if you need to do something that normally requires interpreting ActionScript, find another way to do it. -
How can I load an external SWF into a movie clip that's inside other movie clip?
Hi.
I creating my first flash (actionscript 3.0) website but I'm
stuck with a visual effect I want to create.
I have a window on my website called contentWindow. Every
time you click a button this window is supposed to leave the stage,
load the requested content and return to the stage.
The sliding window is a movie clip with 83 frames, 21 to
enter the stage, 21 to leave the stage again, 20 for nothing (its
just to simulate the loading time) and 21 to return to the stage.
Now my goal is, when the user clicks on a navigation button,
the window exits the stage, loads an external SWF with the content,
and then returns to the stage.
I've the "window" movie clip with an instance name of
"contentWindow". Inside there is another movie clip with an
instance name of "contentLoader". The content that the user
requested should appear inside the "contentLoader".
Now, when the contentWindow leaves the stage, I get this
error message:
quote:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at rwd_fla::MainTimeline/trigger()
If I switch
"contentWindow.contentLoader.addChild(navLoader);" for
"contentWindow.addChild(navLoader);" it works fine, but the
external SWF doesn't move with the window.
How can I load an external SWF into a movie clip that's
inside other movie clip?Hi,
Recently, I have been putting together a flash presentation.
And I am just wondering if the following might help you, in your
communication with the said swf file:
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
onComplete);
function onComplete(event:Event):void
event.target.content.thinggy_mc.y -= 100;
Not the best example, but this allows you to target a mc
within an external swf file. I think if you look up this code, you
will have an answer ;)
Kind Regards,
Boxing Boom -
FAQ: How do I load an external SWF file into a parent SWF file?
A ton of Flash users visit Adobe’s we site every month wondering about how to load an external SWF file from within another SWF.
Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
How do I load more than one SWF?
How do I load a SWF into a specific location in the display list?
How do I resize the loaded SWF?
How do I set its X and Y location?
Here are some additional resources that elaborate on loading content and on working with the display list:
Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
Help > AS3 Developer’s Guide > Loading an external SWF file
Help > AS3 Developer’s Guide > Loading display content dynamically
Loading multiple external SWFs within a main SWF – CreativeCow.net forums
Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
Video tutorial: Preloading in ActionScript 3.0. By Lee Brimelow. A slightly more complicated example, showing how to make the parent SWF display information about the progress of loading the external SWF.
Tutorial: Loading and unloading SWFs - FlashAndMath.com
This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
SWF to SWF Communcation via ActionScript 3.0 (by kglad)quote:
Originally posted by:
NedWebs
You now seem to want to get rid of the swf once it has loaded
and played itself thru. To do that you would need to have something
in the swf itself that triggers its removal in its last frame. The
following might work...
MovieClip(this.parent).removeChild(this);
Unfortunately I couldn't get this to work. I placed it on the
last frame of the SWF to be called - is that right?
I am not sure I am doing it correctly... -
SQL *Loader and External Table
Hi,
Can anyone tell me the difference between SQL* Loader and External table?
What are the conditions under we can use SQL * Loader and External Table.
ThanxExternal tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
Justin -
Need help loading an external SWF
I'm not very proficient in Flash, so any help will be greatly appreciated. I'm trying to load an external SWF with the following code:
T1_Bttn_BloodCar.onRelease = function() {
t1_images_mc.loadMovie("images/T1_Gallery/BloodCar_SWF/T1_BloodCar.swf");
t1_images_mc._alpha = 0;
It loads the SWF, but doesn't play it correctly when I test it. Here's how the loaded movie is supposed to look:
http://www.theroboteye.com/T1_BloodCar.html
But instead, it plays without the transitions, like this:
http://www.theroboteye.com/TRE2009b.html
I've been trying to figure this out for a few days and have tried adding "this._lockroot = true;" to the SWF I'm trying to load, but I can't get it to play correctly. Can anyone tell me what I'm doing wrong? Thanks in advance.Try using the MovieClipLoader class (loadClip method) instead of the loadMovie method. That way you can have a listener that waits for the movie to be loaded and then pull it into play, assigning actions and properties to it after the fact.
-
Trouble loading an external swf file implemented with AS3
I am using Adobe Flash CS3
At first, I tried
swf_mc.loadMovie("//swf file
location");
It gave me
quote:
Warning: 1060: Migration issue: The method loadMovie is no
longer supported.
USE: var l = new Loader(); addChild(l); l.load(new
URLRequest("your url"));.
Well, the given code isn't working at all.
But since it is a migration error, I thought maybe I can just
save it into Flash5 format with AS1. Then it worked with most
external swf files. However, the one I am trying to load is a swf
file with AS3, so my older version swf can't load it at all.
Anyone has any ideas about how to load an external AS3 swf
file?AS3 is a completely different beast than AS1 or 2. loadMovie
was removed from the language.
The answer to your question is two fold. First, Adobe was
kind enough to give us the code when it finds a migration issue.
var _ldr:Loader = new Loader();
addChild( _ldr );
_ldr.load( new URLRequest( "your url") );
Handling progress has also changed. I have a ContentLoader
package on my site that you're free to use that should familiarize
you with the new way that things are done in AS3.
http://sd-dezign.com/blog/?page_id=10 -
LoadMovie- loading an external swf into movieclip in AS3
Im extremely frustrated.........im trying to do something
that was once very simple, which has now become over complicated
unecessecarily.....i want to do a simple loadMovie type action and
load an external clip into a movieclip called ph. my AS2 code would
be:
loadMovie("ExternalMovieClip.swf","ph");
or
on(release) {
loadMovie("ExternalMovieClip.swf","ph");
This no longer works. Can somebody tell me the new code that
i would use with AS3 to do exactly what i just demonstrated? I
honestly dont even want to touch AS3. The only reason i want to use
it is because it makes skinning the components SOOOOOO much easier
than AS2. That is the one and only reason im trying to convert to
AS3. All the new load movie AS3 examples ive seen on google look
like half a page long to do what i used to do in 2 lines. There
must be a simpler and much easier way. I am a designer. It looks to
me like Adobe went back to making flash for programmers only again
leaving us designers out of the mix. Someone please help me, im
desperate. I also have other old code that im sure im going to have
to convert to AS3 for it to still work, and i may eventually need
help with that as well, but ill stick with this loadMovie problem
for now. Any and all help is appreciated. Thankshave a look here:
http://www.smithmediafusion.com/blog/?p=381
use this:
var i =new Loader();
i.load(new URLRequest(”yourSwf.swf”));
myMC.addChild(i)
myMC is the name of your clip on the stage.
Dan Smith > adobe community expert
Flash Helps >
http://www.smithmediafusion.com/blog/?cat=11
http://www.dsmith.tv -
Loading an external swf and unloading the parent one
Hi there i have made a navigation in flash and 3 buttons that load some external swf's. Problem is that when they load the parent swf keeps playing in the background. How can i make them play separately and make the navigation stage dissapear completely when they load?
I have attempted to use the same Loader but it doesnt replace it i dont know why.
var myLoader:Loader = new Loader();
var myLoaderMain:URLRequest = new URLRequest("main1.swf");
var myLoaderQuiz:URLRequest = new URLRequest("quiz.swf");
var myLoaderAnimation:URLRequest = new URLRequest("athens_animation.swf");
var myLoaderVideo:URLRequest = new URLRequest("videogallery.swf");
videogallerybtn.addEventListener(MouseEvent.CLICK, videoFunc);
function videoFunc(curEvt:MouseEvent) {
myLoader.load(myLoaderVideo);
addChild(myLoader);
Quizbtn.addEventListener(MouseEvent.CLICK, quizFunc);
function quizFunc(curEvt:MouseEvent) {
myLoader.load(myLoaderQuiz);
addChild(myLoader);
Animationbtn.addEventListener(MouseEvent.CLICK, AnimationFunc);
function AnimationFunc(curEvt:MouseEvent) {
myLoader.load(myLoaderAnimation);
addChild(myLoader); -
Loading an external swf with a loader
I have a .swf that loads different external swf's into
loaders based on what frame it is in. For all but one frame this
works fine. There's no lag, they load quickly and can be interacted
with with no problem. But, for one .swf it gets really choppy. The
swf itself runs fine but once it is loaded into another swf through
the loader the performance really goes down the drain. I guess I am
wondering if anyone has any suggestions or perhaps different
methods I should try. Thanks in advance.It isn't creating it on the fly.
Insert a new symbol and give it the instance name
placeholder_mc. Drag that onto your timeline and scale it so that
it is the exact same size as your external swf. Then just align the
empty movie clip on the stage where you want to align the external
swf.
loadMovie("external.swf",_root.placeholder_mc);
This just tells it "Okay, take this external flash file, and
stick it INTO that empty movieclip" -
Loading an external SWF from an external SWF
Hello,
I'm somewhat caught between a rock and a hard spot on a flash
site project. Here is the situation:
I have created a parent movie (which loads all external SWFs
inside of it) that has the menu navigation built into it. However,
my client wants me to place some more links inside of the external
SWFs that lead to other pages (external SWFs) of the site. Is this
at all possible? I was hoping there is a way to tell a button in an
external SWF to make the parent movie switch between external SWFs.
Any and ALL help is very much appreciated. Thank you.
Another question: does this involve using the _parent script?
ElijahHello,
Thank you for replying. Here is exactly what I'm needing to
do:
We will call the parent file "index.swf". Inside "index.swf"
I have a "holder" for external swf files to load into when I call
on them from the main menu buttons on "index.swf". When a customer
comes to the site, the "index.swf" file initially loads
"welcome.swf". Inside of "welcome.swf", I have some images that I
want to make into links to other external swf files.
My problem is when someone clicks on one of those pictures I
want the "index.swf" file to open up the corresponding external swf
file in its "holder", where "welcome.swf" currently resides. Also,
all of these swf files ("index.swf" included) have stand-alone FLA
files, none are attached to one another. I have never worked with
"levels" before, would that be necessary in this case? I have
attached the code for the external swf loader.
I hope that gives you a better idea of what I'm trying to
accomplish.
Thanks again.
Elijah
CODE:
Maybe you are looking for
-
In iTunes my iPhone refers me to iTunes on my computer for verification. iTunes won't work on my computer. How can both my iPhone and iPad stand alone?
-
This weekend I purchased the software update for the 1st generation touch from iTunes to update it to version 3.1.3. Prior to the update, the iPod was still 100% working. The only reason I paid for the upgrade was so I could get the App Store. Sin
-
OEM doesn't detect Servlet .init() failure!?!
I'm trying to move some one-time initialization into a servlet .init() method and I wanted to see what would happen in OEM (Oracle Enterprise Manager) when this servlet's init() method failed (by throwing ServletException). I was hoping to see a Stop
-
I am using DnD to drag items from a JTree (drag source) onto another JTree (drop target). This all takes place within a JPanel enclosing a JSplitPane. It works fine when I run this class using a main(), creating a JFrame within the main() and adding
-
when trying to sync my iPhone i get a message saying : iTunes can't sync apps to iPhone because the apps installed on the phone could not be determine. what is going on?