ActionScript 2.0 :: Loading A SWF Into A Movieclip With XML?
Aug 18, 2009
I got some kind of fotoviewer.. it gets the text (under each picture there is a text which is clickable; it opens an URL) and the pictures from an external XML.
Now I'd like to change it.. so when I click on the text (or picture), I want to open a .SWF into a MovieClip which is on my stage. How can I do this?
The part of ActionScript which I should change (I think!):
I'm trying to load a SWF movie into a target movieclip called blankmc. The SWF movie is loaded from an absolute URL (eg. [URL]/img/20042005113934movie3.swf ) My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG! Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?
Im making a movie with a menu that loads movie clips according to which menu is selected simple enough. However, the newly loaded movie clip also needs to allow the user to load another movie into the main movie effectively swapping the first movie clip with the second. This needs to be done without using the main menu.
i am having a main.swf which has a movieclip in the form of a window. it's instance name is window_mc. this window has an empty movieclip called load_mc and i am trying to load another swf called login.swf into window_mc.load_mc using
window_mc.load_mc.loadMovie("login.swf");
both main and login swfs are having resolution 1000x780.. but wen it is loaded as said above, the texts inside the loaded swf looks very large. the resolution looks as if they are different.. i haven't tried loading movieclips much. but wen i load a swf into an empty movieclip, it wrks perfectly fine...
I can get the movieclips into the container movieclip, but they're supposed to float around within the boundaries of container movieclip.Unfortunatly they just float off stage...I THINK THE IMPORTANT PART IS AT THE END OF THE SCRIPT IN THE ON ENTER FRAME HANDLER [code]
Currently I have a MovieClip that when you roll-over it a hover menu pops up. But I also needing to have that same MovieClip when rolled=over load another external SWF inside an empty movie clip.
I have a clip that's 1450 pixels wide, masked to 725 - basically a left side, and a right side. The left side will contain navigation for a portfolio, which when clicked, the movie plays 10 frames during which a movie clip called portholder will slide over from the right, and load the appropriate movie clip. Here's the code on one of the bits of navigation:
[Code]....
Essentially, I'm trying to replicate the effect Your Majesty is using. I'm sure there's a way of using actionscript to slide portholder back and forth, instead of using animation, but alas I'm not a scripter (as you can tell!). But what I'd REALLY like to do is to tell the container clip to wait until it's fully in position before loading whatever.swf, as opposed to having a movie already in progress moving across the screen. Basically tell portholder "Wait until your x value is 0 before loading whatever.swf" I thought about using the setInterval, as recommended to someone else on these forums, so tried:
i am working on this project where i need to load an flv file and then play on its timeline. is there anyway to load an flv file and then for example telling it to stop at frame 50?
I'm developing a map system based on a 20x20 matrix. Only one cell is shown at the same time, and the movement across the map is performed using 4 direction arrows.Each cell is a SWF (30KB+/-) loaded into a different MovieClip. Because of the huge size of the entire map, this is gradually loaded as you're moving in each direction, but this has a problem. At the same time the user is moving from one cell to other, the application preloads the 3 or 4 four cells that will be shown later. When those preloaded cells are attached to the big map, the movement of the map stops for a while and then it moves again. I dont know how to avoid this stop, doing a preload in parallel with the movement.
I have tried using loadMovie, loadClip,...for each map cell.Is there any way to execute in parallel that prealoading?
I am a new forum user and new AS programmer (but an experienced OOP in C++/Java/.NET),now using Flash CS4 on a Windows XP Pro machine.Using pre-loader demos from the web I coded my first AS3 program, it actually works as expected with some SWF movies; but with others it fails to operate properly.What I wanted to do is to create classes for each type of movieclip I have (the movieclips are all 100 frames animations) and when I create the instances with "new" the classes would just load its corresponding movieclip content (A SWF file containing the 100 frames).
Well the first problem I ran into was that if the SWF file is from previous versions (AS2 say) it does not work. Just to let you know because that is not the prolem now.All the program is doing now is loading the external swf into a movieclip instance at the time the class is created, this part works fine always, and then listening to EVERYFRAME events just calls moveNext going from frame 1 to 100, and when I reaches frame 100 it plays backwards by calling movePrevious.
The program works fine with a SWF file I downloaded from the web, but because I am having a hard time finding long animations built with the current version of Flash I tried to create my own SWF files to test, etc... Now the problems:I have 100 frames that I import to the stage into a new movieclip, then I right click on that movieclip in the library and export this movieclip as SWF using Flash S4...which creates the SWF fine and which I can play in a player fine too.However the program fails with this Flash CS4 movieclip ! , for some reason it does not seem to react to the moveNext and movePrevious calls, it just plays from 1 to 100 and them jumps back to 1 again.
Basically I have decided to make this webpage for a client on the left side is the navigationand when they click on some of the buttons, I would like for the MovieClip to load a website so every time a user clicks on the button then on the right side which has the movieclip it would load the URL? Is this possible?
I can get the movieclips into the container movieclip, but they're supposed to float around within the boundaries of container movieclip Unfortunatly they just float off stage.
I have created a drop down menu from which I am loading ext swf to the main screen. I am able to load the ext swf with the follwoing code
on (release) { this._lockroot = true; loadMovieNum("Intro.swf", 7); }
This loads the swf into main timeframe on level 7. I have issue with the position as the swf load top left of the screen. I realise that I have not defined my movieclip with instance name "myContainer" here and I am not sure how to do so.
Imagine a database with a table of some items. Each item has 5 images inside and some other fields. In flash I have a page that duplicates all the items and shows them by thumbnails and a view button for each item. The movieclip that does this is for convenience movieclipA. When I press on the view button of an instance of movieclipA a duplicated movieclip takes place that has all the values of the specific item except of the images.
This movieclip - movieclipB duplicates for each item. This works perfect. I also have another movieclip movieclipC The movieclipB is a slideshow and loads the 5 images for an item by a self generated xml file that a php functions produces, depending on the querystring that is the idstring in my actionscript. I mean that inside the movieclipB I do
So far the movieclipB works very well standalone...and this means that if I assign the querystring value inside the movieclip (for example idstring=1 and then call the function as above, the slideshow works verywell. How to pass for each item a different idstring into movieclipB and where exactly to put the movieclipB so it can be duplicated with movieclipA and take the correct idstring to do its job. Everything I tried to pass the idstring failed.
In the flash page among other code that I don't believe it's important, I have the following actionscript in the action layer Main page frame 1: PHP Code: total = showPost.total; var id:Array = new Array(); var headline:Array = new Array(); var details:Array = new Array(); var thumbnail:Array = new Array(); showPost = new LoadVars(); [Code] .....
VisitorsDetailsClip_mc is the movieclipB I mentioned above. MovieclipA (the one with the thumbnail) and movieclipB are placed on the stage of the main flash page.
I used to work with CS3, but now I have CS4. I want to load jpg picture in movieclip. But it doesn't works. I have tried to load *.swf and it's works. This is my code: _root.createEmptyMovieClip("a",1); loadMovie("small.jpg",_root.a); there are no changes on stage. I have Vista and this all happens in my documents
I am having a problem loading a swf into a movieclip inside another swf. I keep getting this error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at contact_fla::MainTimeline/frame1()
after googling the error, I have come to suspect that I am trying to load the swf before the stage is ready for it. Although, I load another swf and it loads fine. How can I verify which part of my movie is causing the problem?
I need to load a movie clip to the stage from the library. I also need that movie clip to load with a certain string of actionscript code in it. To load the movie clip, i checked the "export for actionscript" thing in the "linkage" section of the movie clip info, and i named the class "sol1" I then used this code on the first (and only) frame: Code: _root.attachMovie("sol1", "NewInstanceName", {_x: 50, _y: 100}); It seems to work, but the question is, how do i load the movie clip with code in it?
im trying load a external images and place them inside individual movieclips. All in a for-loop. My problem is that I only get the last image to load. When I trace "i" in the imageLoaded-function it is allways 5 even if it runs it 5 times. Do anyone know why?
I've downloaded the swf-file and the fla-file and there's three as-files used in those files. The file (fla) show that it use an external class (one of the as-files) and I think the problem is this class also affect the main-movie.
I may be wrong, but if I'm not.. how do I go around this?
I'm currently used to have the as written inside the swf/fla-files and sometimes including them, but not as a class.
I have created movieClips instead of buttons called again "button_1" through "button_7". The issue I'm having is that the movieclips that I want to load XML data into are within a movieclip called movie1_mc. How to load XML data into a movieclip within a movieclip?
I have managed to create a google map api in actionscript 3 and the swf file works fine. I need to imbed it into a flash as2 project which works if I use loadMovieNum("googleMap.swf", 0);
But I want it to load into a movie clip (called loader) and I have tried the following which doesnt work. loadMovie("googleMap.swf", "this.loader");
I can't get to load a movieClip dynamically.I have this code:[code]Also, I exported the movieClip to ActionScript with the name of myButton..When I test the movie- there're no errors, but there's nothing on the stage.
I'm trying to do something that I thought would be quite easy, but now I'm beginning to wonder. The broad description is that I'm trying to load an external .swf into a parent movieclip. (This item must be loaded externally, and can't reside in a library.) Once loaded, I then want to duplicate, resize and rotate the movieclip multiple times.
The problem is that the duplicateMovieClip function doesn't seem to allow me to duplicate my loaded clip, nor does it allow me to place a duplicated item into a parent item (other that at the _root level).
when i load a swf file within another swf file my loadVariables do not show.so basicly i have loadVariables in my as2 movie clip which works fine but hten when i load it within as3 movie clip these loadVariables within the as2 movieclip do not work is there any way of makign this work this is what i used for loading hte variables.[code]
I am using an xml list to hold some data+image for different items. for each item im trying to display the text/images in a movieclip.So im taking the url thats store in the xml file and creating a url loader to load the url. which works fine. but how do i then load that image into a movie clip.Heres the code:
var imgLoader:URLLoader = new URLLoader(); imgLoader.addEventListener(Event.COMPLETE, insertLogo); // do a for loop to get the xml data for the right item.
I have the following code attached to a movie clip which I am using to load various images into. How would I go about finding the total size of the image being loaded so I can put it into a variable. I want to then show this variable value in a text field so the user knows how big the image is that is being loaded.
In my website,click the menu button the corresponding text and image view in the stage.But upload the site in server side image appears after few minutes of the text appears.the problem is how to appear the image