ActionScript 2.0 :: Preload Jpegs Of A Dynamically Attached Mc?
Mar 22, 2004
Well onjce again I have been scanning the threads and cant find a direct solution to my problem, or at least I dont know how to implement it if I have :s Anyway what I am doing is this.I am doing the website for a furnitre company that has a large product catalog, around some 200 photos. In the main swf. I have all the thumbs and when I click on one thumb depending on what category it is, it will load the external swf. and also a variable that says which photo to show (which frame to go to).
for examplle if I click on a thumb of a bed it will load beds.swf with a photo value of 6, which will go to frame 6 in the beds.swf. Now in beds.swf I am attaching a movie clip with an instance name of beds dynamically into an mc called photo_holder using the attachMovie function.
The beds movie clip has 40 - 50 keyframes with an mc on each frame which then holds the bitmap. So the target to one photo would be _root.photo_holder.beds_attached.bed1 Then I have a gotoAndStop(photo); action where photo is the variable I loded from level0. the problem is the following.
I can add a preloader onto a scene before everything, however, I only know how to make the preloader load all the photos. I dont want to do this cause if the user wants to view one photo, they have to wait for all 50 high res photos of beds to load, of course, they wont have to wait for the next bed they click on but its still a pain.
I tried doing some tests last night using the getBytesTotal() function but it only seems to return a value if what I am targetting is in the same frame number where I have that action. Otherwise it returns undefined. Since this clip is loaded dynamically, I have no idea how to preload something that hasnt been called on yet. Or in other words, get the Total Bytes of a photo before showing it, or whatever. Its kinda hard to explain,
View 14 Replies
Similar Posts:
Mar 22, 2004
I am doing the website for a furnitre company that has a large product catalog, around some 200 photos.In the main swf. I have all the thumbs and when I click on one thumb depending on what category it is, it will load the external swf. and also a variable that says which photo to show (which frame to go to).for examplle if I click on a thumb of a bed it will load beds.swf with a photo value of 6, which will go to frame 6 in the beds. swf. Now in beds.swf I am attaching a movie clip with an instance name of beds dynamically into an mc called photo_holder using the attachMovie function.The beds movie clip has 40 - 50 keyframes with an mc on each frame which then holds the bitmap. So the target to one photo would be _root.photo_holder.beds_attached.bed1.Then I have a gotoAndStop(photo); action where photo is the variable I loded from level0.
I can add a preloader onto a scene before everything, however, I only know how to make the preloader load all the photos. I dont want to do this cause if the user wants to view one photo, they have to wait for all 50 high res photos of beds to load, of course, they wont have to wait for the next bed they click on but its still a pain.I tried doing some tests last night using the getBytesTotal() function but it only seems to return a value if what I am targetting is in the same frame number where I have that action. Otherwise it returns undefined. Since this clip is loaded dynamically, I have no idea how to preload something that hasnt been called on yet. Or in other words, get the Total Bytes of a photo before showing it, or whatever. Its kinda hard to explain, does anybody have any ideas?
View 14 Replies
Jun 25, 2006
I'm creating an image gallery and looking for a simple way to preload external jpegs (with % loaded) into an empty movie clip.I'm using thumbnails- there are no "next" or previous "buttons".[code]I've been googling/ searching all day.
View 1 Replies
Apr 13, 2010
I have a file that dynamically loads JPEGs in two sizes (thumbnails and zoom). There is nothing in the AS concerning sizing, only loading and positioning.The site looked fine and now the pictures all have jagged edges to them (it's stained glass and the leading looks edgy instead of smooth). The photos that are loading look smooth upon uploading.I have them Publishing as, Flash Player 8, AS 2.0, JPEG Quality at 100, only Protect from Import is checked, I'm working in Flash CS4 on a Mac.
View 7 Replies
Jul 13, 2004
Does anyone know if Flash has a limitation on dynamically imported jpegs? I find that maybe 30% (maybe more) of the jpegs I have do not import into Flash (using LoadMovie).I think I read somewhere that you can't import progressive jpegs dynamically. Is that it? Or is there something else?
View 4 Replies
Mar 31, 2010
How to load a series of images locally from a folder and create a movie clip for each one dynamically?
View 2 Replies
May 31, 2004
I wanted to know the method to do a dynamic loading of jpegs with click of a button with crossfade between the two jpegs
View 2 Replies
Jan 30, 2004
I was wondering if there was a way to dynamically load JPEGs and read their width/ height attributes before they actually land on stage. I have tried it once wherein I hide the targetted movie clip and try to utilize the INIT functin to check for initialize. This works pretty good except that a little dynamic animation I need tends to act a little later than it should creating a bug if u proceed immediately.
View 4 Replies
Jun 9, 2003
Basically my code at the beginning of the movie queries the server for the file names of jpeg files that are to be loaded into sequential frames. The reason is that the user can enter file names into a database and the application plays them back without the user having to do any flash programming. Currently, my code is using a preloader in each frame along with some additional code to center the picture etc.
This is fine *but* I need all of the jpegs to load before the movie starts, not when the play head gets to each frame. I can't have any delay from one frame to the next. Delay in the beginning of the movie is ok. Can anyone help me with a method to dynamically load these jpegs completely before the movie starts playing?...once loaded they must be available for any frame to call immediately.
View 5 Replies
Oct 20, 2004
I have a gallery that reads an ms access database using asp and then loops through an array of records and duplicates an empty movieclip for each record. jpeg is then loaded into the movieclip and then a variable for the _x position is incremented and then the next one is loaded etc.I then use the same method to add the necessary labels for the images by duplicating a movieclip and adding a text fieldThis is all fine and produces a gallery of images but the problem comes when I try and position the labels according to the height of the image. I have tried every method I can think of to check the image attributes which are only available when it is fully loaded, but I keep getting a value of 0.
Code:
stop();
// Set variable holding image folder path
[code].....
View 1 Replies
Jan 30, 2004
I was wondering if there was a way to dynamically load JPEGs and read their width/ height attributes before they actually land on stage.I have tried it once wherein I hide the targetted movie clip and try to utilize the INIT functin to check for initialize. This works pretty good except that a little dynamic animation I need tends to act a little later than it should creating a bug if u proceed immediately.
View 4 Replies
Mar 7, 2004
how would i go about writing a function that looks at an mc(empty mc) and deletes any attached movie clips (if there are any).
View 12 Replies
Apr 12, 2006
I am building using borrowed code from various tutorials. I am trying to make a grid with a dynamically attached clip(ball), use the grid as a mask for a picture(pic) and tween it forward on the press of a button (red):
[Code]..
My problem is that I cannot get the grid to tween forward on pressing red. I have tried various other ways to call function exp with no success, although I have noticed that:
[Code]...
successfully tweens the container clip for the grid. Furthermore, I have noticed Flash 8 takes some time before testing the movie. Is my code inefficient?
View 2 Replies
May 9, 2005
How do you turn a dinamically attached MC into a mask? I know it works if I actually draw the mask with AS, but is it possible using a library MC (animated)?.
View 3 Replies
Aug 21, 2006
I want to target ALL the 20 clips attached as below, at the same time, when I press the button "blue". However, my code can target only ONE of the clips at any time. I have tried attaching the clips to a separate dynamic clip and then targeting it but problems with the registration point (0,0) of that clip means I cannot achieve the result I want:
Code:
for(i=0;i<20;i++){
mc = this.attachMovie("red","red2"+i,i);
var scaleFactor:Number = Math.random() * 80 + 20;
mc._x = Math.random()*500;
mc._y = Math.random()*400;
mc._xscale = scaleFactor;
mc._yscale = scaleFactor;
blue.onRelease = function(){
new Tween(mc,"_xscale",Strong.easeOut,mc._xscale,200,3,true);
new Tween(mc,"_yscale",Strong.easeOut,mc._yscale,200,3,true);
}}
View 2 Replies
Mar 27, 2008
I am having problems with this and I can't quite figure out what I am doing wrong.I have the following AS inside a function in my movieclip.
this.attachMovie("team_" + whichProfile, "team_" + whichProfile, this.getNextHighestDepth());
var teamProfile = ["team_" + whichProfile];
[code]......
View 3 Replies
Nov 26, 2010
in my package I declared my vars
[Code]....
Is there any way to access these dynamiccaly attached MCs like when I instantiate in Ex 1?
View 1 Replies
Apr 8, 2005
I attached some movieclips dynamically from the library, and the MC contains a button symbol called "myBtn", I would like to let it load another swf on _level3...below is part of my Actionscript.
[AS]
stop();
//-------------------------
this.container.myText.html = true;
[code]....
How would I go about targeting the button instance and tell it to load an swf?
View 8 Replies
Mar 7, 2004
How would I go about writing a function that looks at an mc (empty mc) and deletes any attached movie clips (if there are any).
View 11 Replies
Nov 25, 2010
preload a dynamically loading image.
My header animates then dissapears.
Then after about 2 seconds the dynamically loaded image appears, is there a way to preload the image before the end of the animation?
My code that doesnt work is:
stop();
addEventListener(Event.ENTER_FRAME,loading) ;
function loading(e:Event){
[Code]....
View 6 Replies
Apr 6, 2010
I'm trying to add a preloader to my code (see below) to preload my images:
// for loop
for (p=0; p<401; p++) {
// create array to load images from folder
[Code]....
View 5 Replies
Oct 8, 2009
how I would normally generate a dynamic text field,
Code:
this.createTextField("myTextField", 1, 0, 0, 100, 200);
myTextField.wordwrap = true;
myTextField.text = "text1";[code]....
I would like to target the text field so it is generated inside a movieclip for example something like,
Code:
_root.Mymovieclip.createTextField("myTextField", 1, 0, 0, 100, 200);
myTextField.wordwrap = true;
myTextField.text = "text1";[code]....
View 3 Replies
Nov 20, 2009
I have dynamically attached a number of movieclips inside a another movieclip on the stage, and now I want them to act as buttons, but I can't work out how. They are named as they are created, so I know I can target them, but as to how to assign an onRelease functions to them I have no idea.I don't want to hard code a load of onReleases, as the number of movieclips will change depending on outside data, how I could do this with a loop or something, given that I have an array of their names?
View 4 Replies
Apr 23, 2007
This one has me stumped. I'm missing a trick here I think; so why doesn't this work?
Code:
function makeClouds(clouds:Number) {
for (var i=0; i < clouds; i++ ) {
[code]......
View 5 Replies
Nov 8, 2007
When I dynamically / randomly attach movies to the stage I dont want my movies to overlap eachother... How to do this? I tried using hitTest but that didnt work for me, so I wrote some kind of hittest function myself... but that doesn't work right either.
View 4 Replies
Jun 29, 2008
As you can see I am attempting to assign x,y positions to clips that are being "attached."
var clipArray = new Array();
clipArray = [189, 275, 361]; // x positions
for (var i:Number = 1; i < 4; i++) {
this.attachMovie("clip"+i,"butt_"+i,i,{_x: [clipArray(i-1)], _y: 142});
}
View 4 Replies
Jan 29, 2009
I've got clips being attached using attachMovie (clips are in the library with linkage id's).
inside those clips are two functions. I'm trying to access those functions after I attach the clips, but not getting anywhere.
I assume that the methods of my attached clip (the functions) aren't available immediately, but rather after the clip actually 'loads' to the stage they are.
View 3 Replies
Aug 9, 2004
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6. unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right.further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center.[code]
View 3 Replies
Aug 12, 2011
I'd been working on a side-scrolling shooter game in AS2 for a while and it was going great, but for whatever reason, it scrolls all choppy and the framerate is inconsistent on faster machines. I would have expected the opposite, but it is what is is, I guess. So I'm trying to finally learn AS3, and I found some tutorials that got me started towards remaking what I had, but now I'm stuck.I'm trying to make one of those rotating cannons that shoots projectiles towards the mouse cursor. I have the rotation part working, but I'm having trouble with attaching the projectiles to the stage with enterFrame actions on them.I feel like I'm pretty close to a solution, but I don't understand where to put the functions to move the clips to make them work properly. In AS2, I just put something like this on the cannon clip:
Code:
bullet = _root.attachMovie("bullet", "bullet"+_root.bullets, _root.getNextHighestDepth(), {_x:nozzledot.pointx, _y:nozzledot.pointy});
[code].....
View 1 Replies
Jan 16, 2006
basically i would like to dynamically display and preload an image onto my main movie clip. this image would be the first item in my xml file. on my main timeline i would like to have a few buttons that a user could click to change the default image on the page.
when they select a new image, i would like to have the preloader appear above the default image and then tween between the old and new image (one fading out and one in kinda thing).i sourced some code but i've been having problems preloading the first image. the image loads but the preloader doesn't do anything. it seems like the preloader doesn't seem to recognise that i'm trying to load an image. it thinks it's fully loaded and carries on before the load can begin!i would also like attach a different preloader for the first image displayed than the ones being loaded via the buttons.
View 2 Replies