Autoresizing Movieclip To The Size Of Loaded Image
Hello as per the previous thread i am making an image gallery form xml.I had all the work except the client wants that when image loads inside a movieclip the movie clip size should get changed according to the image size.
Can anybody have an idea about it
Thanks in advance
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-05-2007, 01:44 PM
View Complete Forum Thread with Replies
Sponsored Links:
How To Know Size Of Loaded MovieClip Or Image
Basically I load an PNG or SWF. I load it at this.myContainer.myTarget. When I check the size of either myContainer (a movie clip containing myTarget) or myTarget it-self, I get undefined has a result.
Am I just too tired or is there something I haven't read anywhere... :'(
I just want to centre the loaded image or movie...
Code:
stop();
trace('starting load');
trace(this._parent.PicName);
//loadMovie(this._parent.PicName, this.myContainer.myTarget);
var picLoader:MovieClipLoader = new MovieClipLoader({_x: -37.5, _y: -25 });
var loadListener:Object = new Object();
function ShowPic() {
MyContainer._x = (myContainer._width / 2) * -1;
MyContainer._y = (myContainer._height / 2) * -1;
this.play();
this._parent.play();
trace(this.MyContainer._width + ', ' + this.MyContainer._height);
trace(this.MyContainer.myTarget._width + ', ' + this.MyContainer.myTarget._height);
}
loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
trace(">> loadListener.onLoadComplete()");
trace(">> =============================");
trace(">> target_mc._width: " + target_mc._width); // 0
trace(">> httpStatus: " + httpStatus);
ShowPic();
}
picLoader.addListener(loadListener);
picLoader.loadClip(this._parent.PicName, this.myContainer.myTarget);
trace('Loading Started');
View Replies !
View Related
[FMX2004] - Determining Size Of Image Loaded Into Blank MovieClip (Based On Tutorial)
I'm using the codebase from the Flash/XML Gallery tutorial posted on this website -- http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
Because my images are not all of a uniform size, I need to dynamically find out what the loaded image sizes are and then based on the stage size, center them on my stage. I understand in principle how this is done -- [mcInstanceName]._width, [mcInstanceName]._height. I then subtract these values from the stage w/h and then divide by two.
My issues is that using the codebase at the tutorial link above, it's seems that I can only access the empty movie clip's properties in the onEnterFrame event handler. I thought I could access the empty movie clip's properties anytime the prevImage() & nextImage() functions were call. I trace the values at those point in the code and get "0"
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
// MY ADJUSTMENTS HERE
imgH = picture._height;
imgW = picture._width;
picture._x = (Stage.width-imgW)/2;
picture._y = (Stage.height-imgH)/2;
}
}
The code is not returning the _width & _height values in order to set my _x & _y properties. Any pointers, I'd greatly appreciate.
-MP
View Replies !
View Related
How Do I Get A Loaded Image To Change Size Into The Next Image
ok, that probably sounded a bit wierd here's a link http://www.ronyshram.com/ what I want to do is something I see a lot but don't understand, you click a thumbnail and an image opens, you click another thumbnail and the image fades but the shape/frame resizes or changes from landscape to portrait to fit the next image when it appears.
any tips or AS ideas would be of great help please.
View Replies !
View Related
Loaded Image Size
I'm having a problem with sizing loaded images
I can scale it by percentage which is nice but I want my images to be within a given size say 502 x 310 for example so i want to scale the images mantaining aspect ratio but staying within that frame if i try to change the mc size I get nothing at all not even an error in fact if i trace out the _width I get 0... but if I do the percentage its all good
here is what I have so far
ActionScript Code:
stop();
createEmptyMovieClip("img_mc", 0);
image_name = "scoup.jpg";
img_mc.loadMovie("http://thedomain.com/" + image_name);
img_mc._width = 502;
img_mc._height = 310;
//img_mc._xscale *= 0.5; //50%
//img_mc._yscale *= 0.5; //50%
View Replies !
View Related
Getting Size Of Loaded Image
Hi,
I'm loading a series of images using imageLoader.load(i mage stuff), and stuffing the imageloader into an array for future reference.
The images will have different sizes, and I need the size to position it. However, using the imageLoader.loaderInfo.width is giving me the width of the entire stage. How do I get the width of just the image?
Thanks!
View Replies !
View Related
Size Of Image Loaded In Mc
hi! anyone know how to determine the dimensions of a jpeg after loaded in a movieclip? I'm trying to set xy positions of other clips off the root relative to the image. So, in the main timeline I've got:
_root.attachMovie("ImageObject", "myimage"+count, count+1);
obj = _root["myimage"+count];
obj._x=lastx+12;
obj._y=lasty+4;
obj.loadMovie("./uploads/123/icecream1.jpg");
Right now, my ImageObject is just an exported movie with nothing on it. Image loads just fine, my problem is, what's the height and width of the image (cuz any pic of any size could get loaded)?
Thanks to any and all...
View Replies !
View Related
Get Full Size Of A Loaded MovieClip
Hi guys,
This problem is driving me crazy so please help. I need to load clips into boxes of specific sizes. I have to create this boxes dinamically and the sizes are also dinamic. So I create emptyMovieclips and then I tried 2 aproaches:
1) if I assign a width and height to any box and then try to loadamovie into it, the movies doesn't show.
2) if I load the movie into the box and then try to scale it to the given size for the box then I can never get the actual fullSize of the loadedClip. The size of the loaded clip changes as the movie plays so how would I get the full size so that my scaling works correctly.
Any help would be extremly apreciated, I'm really going nuts over this problem. Thanks in advance.
View Replies !
View Related
MovieClip Size Once Jpeg Loaded
Hi,
I am creating an empty movieclip and loading a jpeg into it. The mc does not seem to resize to account for the jpeg's size, also the parent mc (thisClip) which is also created dynamically (with attachmovie), is set at 500 - i have no idea why:
thisClip.createEmptyMovieClip("theJpeg", 2);
thisClip.theJpeg.loadMovie(url);
thisClip.theJpeg.onEnterFrame = function(){
if(this.getBytesLoaded() >= this.getBytesTotal())
{
delete this.onEnterFrame;
trace(this._width);
}
}
any ideas?
thanks in advance
ash
View Replies !
View Related
Get Full Size Of A Loaded MovieClip
Hi guys,
This problem is driving me crazy so please help. I need to load clips into boxes of specific sizes. I have to create this boxes dinamically and the sizes are also dinamic. So I create emptyMovieclips and then I tried 2 aproaches:
1) if I assign a width and height to any box and then try to loadamovie into it, the movies doesn't show.
2) if I load the movie into the box and then try to scale it to the given size for the box then I can never get the actual fullSize of the loadedClip. The size of the loaded clip changes as the movie plays so how would I get the full size so that my scaling works correctly.
Any help would be extremly apreciated, I'm really going nuts over this problem. Thanks in advance.
View Replies !
View Related
Maximum Size For A Loaded Image?
Is there a maximum size for images loaded using loadMovie? I have a large (4000px) image of a map that works just fine when it is placed in flash but is croped on the bottom and left when loaded with loadMovie.
The only reason I can figure is that it is too big.
View Replies !
View Related
Limit The Size Of A Loaded Image
I need some help...
my flash will load a picture in one movie clip... but i want to limit the size of this movieclip...
someting like this:
var mc:MovieClip = _root.createmptymovieclip("test", 1);
loader.loadClip("picture3.jpg", mc);
the mc will be in the size of the picture... but i want to limit the size, but the picture have to be scaled.
i want to limit it to 500 x 500... so if the image is 400x1000 the mc will have to be 200x500.
how can i do this.
sorry for my english... can any one help me.
tks
View Replies !
View Related
Size Of An Externally Loaded Image?
Hey,
I have a script that loads external jpg files into the Flash movie. Now, I need to get the size of each dynamically loaded image, which would be no problem if I could use the Movie Clip Loader class, but the file has to be published for Flash Player 6. So far I haven't figured out a way to do this... help, anyone?
View Replies !
View Related
Get Dynamically Loaded Image Size
i am dynamically loading jpgs from an xml file in a photogallery. i need to get the width and height of the image, as well as force the image to load into the center of my movie clip (currently it is loading the top left corner of the image into the top left corner of the movie clip...i am allowing the user to drag the image, but want it loaded into the middle).
this is urgent, so any help is greatly appreciated!
View Replies !
View Related
Find Size Of Loaded Image
Hi Forum,
Anyone knows how do i find it out the width and height of the image loaded inside a movie clip. And how i can restrict the user of loading image having a specific size say 300px width and 200px height.
Right now i am unable to have control and the whole page is getting covered by the big images.
Thanks
-------------
aShIsH
View Replies !
View Related
Cannot Set Image Size Of XML Loaded Images
I'm Loading an image into a MC based on an XML file. I'm setting the initial alpha to 0, loading the image, then setting the alpha to 100 once I see that it is fully loaded. The problem is that I want the image to be resized, which is not working. Every time I check the size of the MC once the image is loaded I get 0x0. Here preload code.
ActionScript Code:
function preload(num) { eval("image"+num).loadMovie(url[num],1); eval("image"+num).onEnterFrame = function() { var bytesloaded = this.getBytesLoaded(); var bytestotal = this.getBytesTotal(); var percent = Math.floor(bytesloaded/bytestotal*100); trace(this._width); if(percent >= 100 && this._width > 0 && this._height > 0){ trace(this._width); this._alpha = 100; delete this.onEnterFrame; } }; };
View Replies !
View Related
Find Size Of Loaded Image
Hi Forum,
Anyone knows how do i find it out the width and height of the image loaded inside a movie clip. And how i can restrict the user of loading image having a specific size say 300px width and 200px height.
Right now i am unable to have control and the whole page is getting covered by the big images.
Thanks
-------------
aShIsH
View Replies !
View Related
When Image Loaded Load Next Movieclip's Image?
i have a series of duplicated MCs, each with an image, i want them to load 1 image at a time, and when that is 100% loaded tell the next movieclip to load its images and so on.
And when the final MC has completed loading call an action.
after the 1st mc's image has loaded though, all the others seem to start?!
mc action,
ActionScript Code:
onClipEvent (enterFrame) {
loaded = this.getBytesLoaded()/this.getBytesTotal()*100;
loadedb = this.getBytesLoaded()/this.getBytesTotal()*100;
_parent.percent = Math.floor(loaded) add "%";
//
//
if (loadedb<99 and loadedb>80 or loadedb === 100 and _parent.xxx eq "go") {
_parent._parent["icon" add _parent.k].load_image();
_parent.xxx = "done";
_root.lastv.scrollerz.scrollbar_mcy.reset();
}
if (_parent.i == fff and _parent.xxx eq "done") {
_parent.xxx = "complete";
_root.lastv.scrollerz.scrollbar_mcy.reset();
if (loaded == 100) {
trace(this+"· !¡! ·"+loaded);
_root.lastv.scrollerz.scrollbar_mcy.reset();
}
}
}
load image action,
PHP Code:
function load_image() {
this._visible = 1;
ladeBild(image_main, image_path add file_name);
per._visible = 1;
xxx = "go";
}
View Replies !
View Related
Window Size Doesnt Fit Exactly To Image Loaded?
I need to make a window pop up when clicking a button in flash that will load an image and the window will fit exactly to the size of the image without bars, scrollbars...etc...
go to http://www.andallthatcouldhavebeen.com and enter. Then click on the little box in the left hand bottom corner and an image should pop up in a window that fits it exactly...that's what I need to do, can anyone help!?!??!
Mike
View Replies !
View Related
Grabbing The Size Of A Dynamically Loaded Image?
Hi
probably a simple thing, but I have a movieclip with various layers in it, and I'm duplicating this clip according to an XML document. If the XML indicates an image, I'm grabbing that image from a directory on the server and loading it into the movie clip.
Problem is, the images are all different sizes, so I'm guessing what I need to do is to target the loader box within that movie clip and resize it according to how big the image I've just loaded is.
But as far as I can see, the size of the image loaded is only ever as big as the loader I've put on the stage inside of this movie clip. So its a bit catch 22.
So the question is how do you make the loader scale to fit the image rather than the other way around? I thought about putting the image size in the XML itself, but thought that was cheating a bit. I'm sure theres a better way.
I've had a look through the forum but could only find things for AS2 not AS3. Any help would be appreciated.
Thanks in advance
Edward.
View Replies !
View Related
Change Size Of Image Loaded As URLRequest
I want to display a callout box that has a title bar. I've created "chunks" of the callout box with images that I will assemble once loaded: A chunk of the titlebar, the left corner of the title bar, the right corner, the borders, etc. Each of these chunks is a .swf file that I'm loading with a URLRequest from my Callout class.
My problem is that, once I get the images loaded, I want to be able to change their size as well as position them. For example, I want to make the callout as wide as an argument I pass to the Callout class, so I need to change the width of the title bar image.
Positioning is no problem. But, because the titlebar image is loaded the way it is, it has zero width, and that width cannot be changed.
I have tried creating a container sprite for the image, and changing the width of the container, but that doesn't work either.
How do I do this? I'm thinking that maybe the Loader var that brings the image in can be cast as a Sprite or something, but I don't know how to do that.
Many thanks!
View Replies !
View Related
[FMX] Changing Size Of Dynamically Loaded Image In Scrollpane
Hello,
I've been trying to figure this out for a few days now...
I use MX 2004 and need to populate one of Flash's scrollpane components with many dynamic images. They are all smaller than the scrollpane stage but are different sizes from one another. I therefore want to change their width and height within Flash to make them about the same size each.
I have loaded them into empty movie clips which I intend to resize but I am aware that I cannot do this until they have fully loaded.
My question is... how do I check when they are fully loaded and amend their height/width/scale from within the scrollpane component?
I normally do this checking getBytesLoaded against getBytesLoaded but this is normally spread over a few frames in order to achieve the necessary looping to keep on checking.
It would appear however that the scrollpane component requires everything done in its first frame. Whenever I place anything in subsequent frames I lose my ability to scroll.
So anyone know of a way to achieve checking the image/movie has loaded and change its size all within one frame?
Thanks in advance for anyones help!
View Replies !
View Related
[FMX] Changing Size Of Dynamically Loaded Image In Scrollpane
Hello,
I've been trying to figure this out for a few days now...
I use MX 2004 and need to populate one of Flash's scrollpane components with many dynamic images. They are all smaller than the scrollpane stage but are different sizes from one another. I therefore want to change their width and height within Flash to make them about the same size each.
I have loaded them into empty movie clips which I intend to resize but I am aware that I cannot do this until they have fully loaded.
My question is... how do I check when they are fully loaded and amend their height/width/scale from within the scrollpane component?
I normally do this checking getBytesLoaded against getBytesLoaded but this is normally spread over a few frames in order to achieve the necessary looping to keep on checking.
It would appear however that the scrollpane component requires everything done in its first frame. Whenever I place anything in subsequent frames I lose my ability to scroll.
So anyone know of a way to achieve checking the image/movie has loaded and change its size all within one frame?
Thanks in advance for anyones help!
View Replies !
View Related
Resize Loaded Image To The Size Of The Constantly Resized Container
Hi all!
Here's my problem:
I have a function that redraws the container clip every frame. While the function is running I need to download an image inside the container and to resize the image to the size of the container. The particular problem is that if the picture is bigger than the container, when it'll be downloaded the size of the container will be the same that of the picture.
Here's a simplified code:
Code:
var MCL:MovieClipLoader = new MovieClipLoader();
var MCLL:Object = {};
MCLL.onLoadComplete = function(mc:MovieClip){
/*
When this is called, the mc's width and height are 0
*/
}
MCL.addListener(MCLL);
var container:MovieClip = _root.createEmptyMovieClip("container", 0);
container.h=5;
container.w=5;
_root.onEnterFrame = function(){
container.clear();
container.beginFill(0, 100);
container.moveTo(0, 0);
container.lineTo(container.w, 0);
container.lineTo(container.w, container.h);
container.lineTo(0, container.h);
container.lineTo(0, 0);
container.endFill();
container.w+=5;
container.h+=5;
}
MCL.loadClip(container, "image.jpg");
Thank you for any help.
View Replies !
View Related
Change Externally Loaded Image's Size On Container Clip
greetigs...
i want to be able to load an external image file using:
loadMovie("myimage.jpg", container_mc)
i guess this is right, given that container_mc is the instance name of my container-placeholder clip.
i have read that upon loading another SWF/image on a container clip, ALL of it's inside content is lost. That's why we want it empty in the first place....
correct me if i am wrong please..
now, i want to reference the (dynamically loaded-external) image that is loaded inside the container clip and preferably change it's _width, _height properties (if they can be applied to the dynamically loaded image)...
anyone has any suggestions..???
thank u in advance...!
View Replies !
View Related
[F8] Remove Loaded Image From Movieclip
I have this XML gallery with loads of different categories. I want to make a button that clears the image that is loaded in the movie clip when I click on it. Can some one tell me how I'm gonna do this plz
thanx.
Code:
var x:XML = new XML();
x.ignoreWhite = true;
var urls:Array = new Array();
var captions:Array = new Array();
var wis:Number;
x.onLoad = function() {
urls = new Array();
captions = new Array();
var photos:Array = this.firstChild.childNodes;
for (i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
wis = 0;
}
classic_mc.onRelease = function() {
x.load("XML/gallery/invitations/iClassic.xml");
}
handmade_mc.onRelease = function() {
x.load("XML/gallery/invitations/iHandmade.xml");
}
unique_mc.onRelease = function() {
x.load("XML/gallery/invitations/iUnique.xml");
}
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = holder.getBytesTotal();
loaded = holder.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (holder._alpha<100) {
holder._alpha += 10;
}
}
};
/////////////////////////////////////////////////
//previous button
previous_btn.onRollOver = over;
previous_btn.onRollOut = out;
previous_btn.buttText.buttonText.text = "previous";
function over () {
this.gotoAndPlay(2);
}
function out () {
this.gotoAndPlay(7);
}
previous_btn.onRelease = function() {
if(wis > 0) {
wis--;
holder.loadMovie(urls[wis]);
caption.text = captions[wis];
}
}
//next button
next_btn.onRollOver = over;
next_btn.onRollOut = out;
next_btn.buttText.buttonText.text = "next";
function over () {
this.gotoAndPlay(2);
}
function out () {
this.gotoAndPlay(7);
}
next_btn.onRelease = function() {
if(wis < urls.length-1) {
wis++;
holder.loadMovie(urls[wis]);
caption.text = captions[wis];
}
}
View Replies !
View Related
Setting Width On Movieclip With Image Loaded
Hey,
I am trying to load an image into a movieclip and then change the width of the movieclip. The problem I am having is that when I do this the image is no longer visible.
Any help is greatly appreciated
Code:
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var container:MovieClip = new MovieClip();
addChild(container);
var pictLdr:Loader = new Loader();
var pictURL:String = "image.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function imgLoaded(event:Event):void
{
container.addChild(pictLdr.content);
}
//change the width
//If I comment out this line I can see the image fine.
container.width = 100;
View Replies !
View Related
Imagesize Of External Image Loaded Into Movieclip?
Hi,
I need to centralise an image that I load in an "image viewing panel" that I had to make. The loaded images have different width and height values (so I can't use a mask). I was looking to get the width of the movieclip before and after I loaded the image into it, but eventhough the image is huge, it doesn't change the width of the image. In order to position the loaded image, I should be able to get the width and height values through ActionScript in Flash, but I can't find a way to do that. Anybody have some advise?
Thank you...
View Replies !
View Related
How To Change The Width And Height Of An Image Loaded In A Movieclip
Hi
I would like to know how I can modify the size properties of an image that is loaded in a movie clip with Loader()
In my example, if I change the width and height properties of the movieclip in which the image is loaded, the image can't be seen anymore
If I don't modify the width and height properties, then the image can be seen
What should I modify in my code so that I can change the size properties and still have my image on the scene?
Here is my code
Code:
var imgLoader:Loader = new Loader();
var image:URLRequest = new URLRequest('model.jpg');
var imgDisplay:MovieClip = new MovieClip();
imgLoader.load(image);
imgDisplay.addChild(imgLoader);
// if I change width or height,
// the image can't be seen, why?
imgDisplay.width = 50;
imgDisplay.height = 50;
addChild(imgDisplay);
many thanks for your help
View Replies !
View Related
How To Change The Width And Height Of An Image Loaded In A Movieclip
Hi
I would like to know how I can modify the size properties of an image that is loaded in a movie clip with Loader()
In my example, if I change the width and height properties of the movieclip in which the image is loaded, the image can't be seen anymore
If I don't modify the width and height properties, then the image can be seen
What should I modify in my code so that I can change the size properties and still have my image on the scene?
Here is my code
Code:
var imgLoader:Loader = new Loader();
var image:URLRequest = new URLRequest('model.jpg');
var imgDisplay:MovieClip = new MovieClip();
imgLoader.load(image);
imgDisplay.addChild(imgLoader);
// if I change width or height,
// the image can't be seen, why?
imgDisplay.width = 50;
imgDisplay.height = 50;
addChild(imgDisplay);
many thanks for your help
View Replies !
View Related
How To Change The Width And Height Of An Image Loaded In A Movieclip
Hi
I would like to know how I can modify the size properties of an image that is loaded in a movie clip with Loader()
In my example, if I change the width and height properties of the movieclip in which the image is loaded, the image can't be seen anymore
If I don't modify the width and height properties, then the image can be seen
What should I modify in my code so that I can change the size properties and still have my image on the scene?
Here is my code
Code:
var imgLoader:Loader = new Loader();
var image:URLRequest = new URLRequest('model.jpg');
var imgDisplay:MovieClip = new MovieClip();
imgLoader.load(image);
imgDisplay.addChild(imgLoader);
// if I change width or height,
// the image can't be seen, why?
imgDisplay.width = 50;
imgDisplay.height = 50;
addChild(imgDisplay);
many thanks for your help
View Replies !
View Related
Drag/Drop MovieClip With Externally Loaded Image File
Hola people,
I'm trying to load an image into a movie clip and then be able to drag the image/movie clip. So far the image loads into the mc very well independantly and with the drag drop function. However.. the drag and drop function works ONLY independantly and not in conjuntion with the loaded mc image.
I've placed the code below into an actions layer(first layer):first frame.
Please help ......what am I missing or done incorrectly?
//////////////
// this part works alone and with the proceding drag/drop function
/////////////
//get the image url/filename (image.jpg) from the text file (image_URL.txt)
loadVariablesNum("image_URL.txt", 0);
//when the movie receives the url/filename (image.jpg) data
//the url/filename(image.jpg) is placed into the image1_mc movie clip
onData = function() {
image1_mc.loadMovie (image1_URL.text);
};
//////////////
// this part works alone but not along with the preceding image load
/////////////
// this function sets up a movie clip drag drop and target function
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(1);
}
};
//the variables below store the clips starting position
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
//the variables below store the clips end position
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
//"if the mouse is up(in other words - the clip is not being dragged)
//then move the MC back to its original starting point (with a smooth motion)"
clip.onEnterFrame = function() {
if (!this.beingDragged && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/5;
this._y -= (this._y-this.myHomeY)/5;
}
};
}
//this is SUPPOSED to implement the drag drop function to the image1_mc being [image1.jpg]
dragSetup(image1_mc,target_1);
View Replies !
View Related
Preventing External Swfs Loaded Into A Movieclip Image From Stacking
So I've been building a webpage that contains 5 "content" sections each loaded on their own swf files into a movieclip called loader_mc when I click the corresponding button. So far, my code works to load the swf's into a movieclip entitled loader_mc when I click on the respective buttons but when I try to change sections, that's where things unravel.
The "samples" section streams video, and when I leave the "samples" section, the audio is still streaming even if I'm looking at the "about" page (or any of the other for that matter). It seems as if my swf's just keep loading one on top of another (not what I want), where what I want to accomplish is to have the swf files replaced upon clicking a button with whatever swf is appropriate to the section I've just clicked. That way dynamic content doesn't sound or appear to be playing even when the user is supposed to have made it "go away". Below I've pasted the code that I think you'll all need to see in hopes you may be able to assist me in tweaking my code to get it to operate.
Here's where I defined my variables:
var contentLoader:Loader = new Loader();
var aboutURL:String = "z_about.swf";
var aboutRequest:URLRequest = new URLRequest(aboutURL);
var samplesURL:String = "z_samples.swf";
var samplesRequest:URLRequest = new URLRequest(samplesURL);
var contactURL:String = "z_contact.swf";
var contactRequest:URLRequest = new URLRequest(contactURL);
var linksURL:String = "z_links.swf";
var linksRequest:URLRequest = new URLRequest(linksURL);
var homeURL:String = "z_home.swf";
var homeRequest:URLRequest = new URLRequest(homeURL);
And here's an example of one of my buttons codes for the Click event:
function linksClick(event:MouseEvent):void
{
zMenu.links_words.gotoAndPlay("click");
contentLoader.load(linksRequest);
loader_mc.addChild(contentLoader);
}
Does anyone have any idea where I might have gone wrong? I've made it this far mostly through tutorials, but I think I'm in a little over my head at combining the things I've picked up without forgetting important elements. Any help is greatly appreciated.
View Replies !
View Related
Duplicate MovieClip With Loaded Image... Making A Crazy Photo Slider
I wanted to make a image sliding effect like this: http://www.eccentris.com/ecce.htm
So far what I am thinking of doing is making about 5 movieclips with a mask, and loading an image into a clip, then moving the image to a certain _x position so that 5 clips all have the photo with the _x position so they can all fit together. Then I'll have them tween from the center outward to fit.
I got that to work, now I want to do it while loading an image. So I was thinking: make a movieclip with the mask and empty container being masked. Then load the photo into that container, and copy that clip with the mask and container, then move the photo's x position for each duplicated clip and have them tween into position.
Would this work? And if so, how do I duplicate a movieclip with a loaded photo? because right now it's not working. I can duplicate the movieclip if there's just a rectangle in it, but not when there's a photo.
View Replies !
View Related
Loaded External Image Question: Use Default Image If Loaded Image Not Found?
Hello,
I use the following code to load an external logo into a Flash Movie.
Quote:
var myRequest:URLRequest=new URLRequest(logoPath);
var loader:Loader = new Loader();
loader.load(myRequest);
holder_mc.addChild(loader);
What if the logo file is not find? I wish that if the logo is not found, another default logo will be used, i.e.
if (logoPath is here) {
var myRequest:URLRequest=new URLRequest(logoPath);
} else (logoPath is not here) {
var myRequest:URLRequest=new URLRequest("defaultlogo.png");
}
How can I do that?
Thanks and best regards
Alex
View Replies !
View Related
Dynamic, Autoresizing, HORIZONTAL Xml Menu Problems.
Im looking for a bit of help on creating an extenal xml driven HORIZONTAL menu, where its possible to:
- add or remove xml entries, causing the horizontal menu to resize appropriately.
- entries shouldnt overlap each other in the bar.
Currently, I have created an xml driven horizonal menu, however i am having trouble spacing them out evenly and automaticaly across a 750px navbar.
Conceptually, while in a for loop I take the textfield.textwidths of each xml entry after grabbing the data from the external file, then summed them up for the character total. I then
create a "space" variable based off of the total width of the navbar minues the character sum, then divided by the number of entries in the xml file. (object.length)
lastly, Im having problems with the line of code to actually PLACE the menu objects. item._x = ????
The reason I have to ask is because most XML tutorials/movies all run vertically, and therefore dont have to worry about autosizing/running in to each other.
A bit of a complex question...thanks ahead for your help!
View Replies !
View Related
Targeting Thumb Nail Image In Image Scroller To Full Size In Middle Of Screen
Hi people....
Thanks for your time....I`m basically looking for ideas on how to do the following. Most of the work is done all I need I hope is a little actionscript... ( I hope)
I`m building a scrolling picture gallery for someone where they want the thumbnail images, once clicked upon to scale very large in the middle of the screen on top of the image scroller. When the image is clicked it zooms back down to where it was clicked upon in the scolling image gallery. The site that best describes this is http://www.chris-bailey.com.
I can do the scrolling image gallery (well, thanks to other friendly flask kit people) and get the user to click the image buttons to load a movie above the scrolling gallery but its targeting the moving images in the scroller to target to the middle of the screen and stop moving and then go back down to the moving scroller.... All the images in the scroller are seperate movies that are obviously easy to scale but I need to turn off the scrolling action when they start scaling into the main movieso they remain still to view. Any ideas please? Using Flash MX.
Thanks.... Angus
View Replies !
View Related
Flash File With *only* One Image Double The Size If The Image?
I have a Flash file.
All I've done is to stick in one image file.
I've got the image publish setting to be 100%.
I publish the file.
The resultant SWF file is double the size of the image.
I would have thought that it should be the same or just a tiny bit bigger files size than the image.
(The image itself is an image I edited in Photoshop... and optimised for the web.)
Where am I going wrong?
Thanks.
OM
View Replies !
View Related
Flash File With *only* One Image Double The Size If The Image?
I have a Flash file.
All I've done is to stick in one image file.
I've got the image publish setting to be 100%.
I publish the file.
The resultant SWF file is double the size of the image.
I would have thought that it should be the same or just a tiny bit bigger files size than the image.
(The image itself is an image I edited in Photoshop... and optimised for the web.)
Where am I going wrong?
Thanks.
OM
View Replies !
View Related
|