MX 2004 PRO: How To Duplicate A Loaded JPEG
Hello! I know it is somehow not possible to duplicate a loaded jpeg file... but I really do need to do it...
I wouldnt like to reload from cache the same JPEG file dozens of times for a slide show...I have this cool image composition effect but it only works with internally linked files...
Can anyone help me?
how to use duplicateMovieClip with externally loaded jpegs? or some similar workaround?
thank you! Pippo
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-19-2004, 07:04 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Duplicate Loaded 'JPEG Movies': No Image Replication?
Hi! My script to create duplication of movies (that are jpgs loaded) was supposed to work, but it seems that
flash doesn't like me :
I was thinking of doing (something like):
Code:
_root.createEmptyMovieClip("x", 1);
_root.x.createEmptyMovieClip("x", 1);
_root.x.x.loadMovie("x.jpg");
then, a few frames later (to assure the load)
Code:
stop();
_root.x.duplicateMovieClip("x2", 100);
_root.x2._x = 400;
_root.x2._y = 400;
but it doesn't duplicate the image : if we
Code:
trace(_root.x2);
it's there, but
Code:
trace(_root.x2._width)
traces 0 : Did anyone already done this? Or know how to?
Thanks!
Leo Lima
JPEG Loading... How Do I Wait Until The Jpeg Has Loaded
Hi everyone!
this is the code that I currently use. I want to be able to wiat until the jpeg is loaded before going trought the loop again.....
any ideas? I have tried to use the getBytesLoaded and getBytesTotal but they always show up as 0. Very annoying.
Code:
var currentX = 0
for (k=0;k<galleryVar.items;k++){
_root.thumbslider.createEmptyMovieClip("thumb" + k,(50 + k));
eval("_root.thumbslider.thumb" + k)._x=currentX;
loadMovie(_root.categoryList+"/thumbnails/"+_root.imageArray[k]+".jpg",eval("_root.thumbslider.thumb" + k));
currentX = currentX + eval("_root.thumbslider.thumb" + k)._width;
trace("Pic" + k + " " + currentX);
}
the "currentX" (2nd line from the bottom) doesn't get a value because the jpeg doesn't get loaded quickly enough. How can I wait for the jpeg to load before going through the loop again.
I don't want to use frames becasue I am creating everything dynamically!
Am i making sense?
Hope someone can help me!
Thanks
A
Duplicate MC With Dinamiclly Loade JPEG
duplicating mc with dynamiclly loaded JPEG doesn't work
it duplicated MovieClip but without JPEG
so I used bitmap to duplicate those type of mc's and here is a solution
ActionScript Code:
import flash.display.*;
function duplicateMC(mc:MovieClip, mc2:MovieClip) {
mcBMP = new BitmapData(mc._width, mc._height, false, 0x00FFFFFF);
mcBMP.draw(mc);
mc2.attachBitmap(mcBMP, this.getNextHighestDepth());
}
External Jpeg Resize(sorry If Duplicate Post)
Flash MX 2004
I am creating a template for freshmen in highschool. the problem i have is i am importing jpeg's from an external folder but they wont resize to fit the viewer.
here is my current code:
square._alpha = 0;
whichPic = 1;
var element = ("Wallpaper/image"+whichPic+".jpg");
//initiate change to new image when buttons are clicked
next.onPress = function() {
if (whichPic<20 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
input = whichPic
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("Wallpaper/image"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;}
// m_dethouars@hotmail.com
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
// limit input field
if (input>20) {
input = 20;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
};
element.onEnterFrame = function() {
var w = this.square._width;
var h = this.square._height;
if(w > 0 && h > 0) {
var scaleFactor = Math.min(288/w, 209/h)* 100;
this._xscale = this._yscale = scaleFactor;
delete this.onEnterFrame;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
input = whichPic;
};
I tried using code from a previous post but it did not do the trick. Any help will be greatly appreciated...
sencerly- Master of Pies
Duplicate Radio Button Problem - MX 2004
Hi - I'm trying to duplicate the radio button component on the fly in MX 2004. I want to duplicate the buttons based on an array and then position them one below the other vertically as I duplicate them. The problem is that the label portion of the component is not properly autoSizing to compensate for the dynamic value I am assigning to it. I have tried the global and movieClip methods of duplicateMovieClip as well as using the new UIObject Class but nothing seems to help me. As you can figure out , I can't accurately place clips if the text is not showing properly as this affects the height/width.
So can anyone help me figure out how to get the labels to show all the text I am trying to set to it on the fly? Thanks!
-sarge
Event On Loaded Jpeg
Is it possible to know when a jpeg has fully loaded into a movieclip?
If so How?
////////////////////////////////////////
Is this the method?
onClipEvent(data) {
goToAndPlay(2);
}
Checking To See If Jpeg Is Loaded
hi,
i am trying to use the search to see if there are any realted questions but i am having a bit of a lag
how can i check to see wheter a jpeg file is loaded or not so i can create a preloader
Kendal
Check If JPEG Loaded?
Loading a JPEG (the url of which is the var "iphoto")
loadMovie(iphoto,"_root.galleryPhoto");
_root.photoPhoto.gotoAndPlay("displayed");
I must wait for the image to load before I go to the next frame. How do I do this?
Checking Whether A Jpeg Is Loaded In MX
Never done this before; I'm loading a jpeg as an MC into MX using this:
backpic.loadMovie("pic4.jpg");
I don't want the _root movie to do anything until the jpeg is fully loaded. How do I ask if it's fully loaded? Do I have to do anything special because it's not a .swf?
Any help would be great.
Thanks.
Can I GetProperty From Loaded Jpeg? Huh
is there a way to retrieve a property from a loaded jpeg...mainly its hieght and width and position ....
and then change that property
i know i can use the MC it loads into but that does not tell me the properties of the loaded image.
some insight would be muchly appreciated
Loaded Jpeg Won't Go Away + X,y Problem
Hi
I have externally loaded jpegs using AS in an external AS form on a sever.
Everything seems to work great. The images are zoomable and everything. Check it out. http://www.members.shaw.ca/creatifdesign/
There is ONE problem and it's BIG.
When you click on any other menu links the previously loaded jpegs don't go away.
The menu links already have AS telling the play head to go to the appropriate frame labels like this.
on (release) {
gotoAndPlay("contact");
}
So how, where and what AS do I add to "clear" any previously loaded jpegs?
Check If Jpeg Has Loaded
I searched the boards, googled it but I don't come accross any good solution.
Is there some standard script wich cheks if the jpeg is fully loaded then executes another movie to play.
This is how I preload the jpeg :
onClipEvent (enterFrame) {
total = _root.beeld.pictures1.getBytesTotal();
loaded = _root.beeld.pictures1.getBytesLoaded();
this._xscale = (loaded/total)*100;
_root.percent = Math.round((loaded/total)*100);
}
Then I check if it has loaded completely and want another movie start playing.
Well this part isn't working :
if (_root.percent == "100") {
_root.beeld.gotoAndPlay(2);
}
What's wrong here?
Determining If A Jpeg Has Loaded?
I have the following load code:
Code:
_root.loaderMC.loadMovie("new.jpeg");
and what I'd like to do is to have the timeline hold there until the rather large jpeg has finished loading. What's the easiest method to accomplish this?
Thanks in advance!
Specifying Location Of Loaded Jpeg
Hi there,
I'm using the LoadMovieNum command to load a jpeg file from a website. I have it loaded correctly but I'm not sure how to specify the location of it in my movie. If I use this command to load another swf file, I just put this.x = number and this.y=number in that swf file and it will go to that location. Obviously I can't use this method for a jpeg file. Thanks,
Centering Loaded JPEG In MC
Hi guys. I've looked all over the forums for an answer to this. Basically I want to know how you can load a JPEG in a MC and keep it centered?
For example: I'm working on a photography site. Some pix are vertical and some horizontal. Each shows up in different positions according to their top left corner.
How can you work around this and have them be centered in a movie or area? I will gladly PayPal anyone $40 for a solution!! (Yes I am that desperate for a solution!)
Thanks for any help!
- Will
Resizing Loaded Jpeg
I don't get why this doesn't work.
Code:
_root.createEmptyMovieClip("container",10);
container.loadMovie("picture.jpg");
container._x = container._y = 0 ;
container._height = container._width = 50;
I cannot see anything when I test the movie, however if I take out
container._height = container._width = 50;
I can see the picture, but it is not resized.
Centering Loaded JPEG In MC
Hi guys. I've looked all over the forums for an answer to this. Basically I want to know how you can load a JPEG in a MC and keep it centered?
For example: I'm working on a photography site. Some pix are vertical and some horizontal. Each shows up in different positions according to their top left corner.
How can you work around this and have them be centered in a movie or area? I will gladly PayPal anyone $40 for a solution!! (Yes I am that desperate for a solution!)
Thanks for any help!
- Will
Resizing Loaded Jpeg
I don't get why this doesn't work.
Code:
_root.createEmptyMovieClip("container",10);
container.loadMovie("picture.jpg");
container._x = container._y = 0 ;
container._height = container._width = 50;
I cannot see anything when I test the movie, however if I take out
container._height = container._width = 50;
I can see the picture, but it is not resized.
Preloading A Jpeg Loaded Into A Mc
ActionScript Code:
this.createEmptyMovieClip("holder_mc",1);
holder_mc.onEnterFrame=function() {
this.bytes_loaded = Math.round(this.getBytesLoaded());
this.bytes_total = Math.round(this.getBytesTotal());
this.getPercent = this.bytes_loaded/this.bytes_total;
this.totalpercent = Math.round(this.getPercent*100)
if (this.bytes_loaded== this.bytes_total) {
trace(this.totalpercent);
}
};
holder_mc.loadMovie("images/kuy.jpg");
i am trying to preload a jpeg that is loaded into created movieclip name holder_mc and display the percentage that is loaded .. before showing it .. my code dont seems to work what seems to be the problem
thanks
How Do I Check If Jpeg Is Fully Loaded?
I know in Flash MX I can load in jpegs with loadMovie(). What I'm wondering is, how can I check (maybe using Actionscript?), whether that image is loaded (showing) or not?
Second question is: I notice that images loaded this way don't show up until they're 100% loaded, right? Is there a way to make it load progressively?
Thank you for any help,
~jimmy.
Keeping A Loaded Jpeg In Cache
I want to load a jpeg into a movieclip and have it stay there to refer to it later. Meaning I could have the timeline go past the movieclips existence and still have the ability to go back to it without having to wait to reload the jpeg.
Thanks
Positioning A Loaded Jpeg(not TheMC)
i understand how to position things using x,y... however....
i want to centre the loaded jpg in the movie(and not the movie itself)..problem is i'm using a variable to reference the jpeg.
how do i get the width and hieght of my loaded jpeg and then apply it so i can centre it in my holder_MC(which is the same size as the stage)
//this works fine
on (press) {
_global.newimage="pict1.jpg"
loadMovie(newimage,"holder_MC");
//this does not work!...WHY?
newimage._x=(stage._width/2)-(newimage._width/2)
trace(newimage._x)...//returns "undefined"
please help me figure this out!
I do not want to position the movie.I need to centre the image in the movie! THANKS A BILLION
Keeping Loaded Jpeg In Cache?
Hallo there
I am loading jpgs into my movie. The problem is every time I load the jpg again, flash seems to take it from the server, not from the cache...
So I'm generating lots of traffic...
Is there a way to have the jpgs cached on the local client?
Masking A Loaded Jpeg SetMask?
Alright, I am given up on trying to figure this problem out, but hopefully someone else might have some insight.
I have my main movie, from there I load my other pages with loadmovie into an empty clip, so within that clip I am trying to do another emptyclip with a mask, in which I will swap out the picture to be loaded. I have tryed having a empty movie clip in the timeline and it doesn't achieve what I need, so I have tried doing it with actionscripting and using
_root.emptyclip.createEmptyMovieClip("imageholder" , 1);
_root.emptyclip.loadMovie("image1.jpg", _root.emptyclip.imageholder);
_root.emptyclip.imageholder.setMask(_root.emptycli p.mask);
and so on...
The image loads great, but the setMask I have never used before and I am not exactly sure how to do it.
Does it need to already be in the timeline?
Can it be a mask layer already in the timeline?
When you specify it as a mask in actionscripting does it not show at all after you publish?
Also if anyone knows how to assign a link to the jpeg that has been loaded that would help a ton!
Thanks for taking the time,
Eric Ehle
Position An Externally Loaded Jpeg?
Hi,
I load a jpeg into a target mc.I re-usethis mc to load various jpegs.
NewsImage.loadMovie("news/" + TargetImage);
where target image is the name of a jpeg.
is there a way to position the jpeg after it loads? I want to center them in a window but they are different sizes.
I could do this with an external swf by putting code in it, but how with a jpeg?
thanks
mark
Placing A Frame Above Loaded Jpeg
ok this is my problem i am loading images from my server.. so far so good. Now i want to add a layer within the movieclip that that holds the image Above the image so as to act as a frame.
//cycle is a variable in my movie
this["newClip"+cycle].loadMovie(location);
this["newClip"+cycle].attachMovie("frame",
"frame"+cycle, 10);
is this the right code, am i on the right path?
is it because using load movie the image actually REPLACES the empty movie clip. I'm abit stuck.. but in the above code the load movie bit works just fine.
anybody have any ideas
Width Of A Loaded Jpeg Image
Hello,
I dynamically create movieclip and load a jpeg image on each with these two methods: createEmptyMovieClip and loadMovie. Then I need to known the size in pixels of each created movieclip to place them correctly in my main clip. Unfortunately the properties _width and _height of each clip returns always 0. Why? Do you know a trick to recover the size of the image? ( I have to find a simple solution because my program must load about 1200 different pictures )
Many thanks Bye Alain
Problem With Getting Data For Loaded Jpeg
hi
//i've created a couple of MCs inside holder1 (this) MC:
this.createEmptyMovieClip("mc", 1);
this.mc.createEmptyMovieClip("jpg", 1);
//jpg MC is a container for loading a jpeg:
this.mc.jpg.loadMovie("project1/1.jpg");
//now i want to get the bytes loaded so i can include a basic preloader:
this.mc.onEnterFrame = function () {
var loaded = this.mc.getBytesLoaded();
var total = this.mc.getBytesTotal();
if (loaded < 4) {
trace ("not loaded");
if (loaded > 4 && total > 4) {
trace ("loading");
if (loaded == total) {
trace ("done loading");
delete this.onEnterFrame;
}
}
}
};
// with the above i'm just getting the following output:
not loaded
not loaded
not loaded
not loaded
...
// why is this not working? any ideas??
// i've tried a different approach using a preloader in another MC. instead of using the above function i have:
_parent.loader.gotoAndPlay(2);
// this loader MC has this on fr3:
total_bytes = _parent.holder1.mc.getBytesTotal();
loaded_bytes = _parent.holder1.mc.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.ba.target = (percent_done);
if (bar.ba._width>99) {
gotoAndStop (4);
}else{
gotoAndPlay (2);
}
// but this isn't working either!!
// please can someone see where i'm going wrong?? THANK YOU
Centering Externally Loaded Jpeg
Trying to load and center different size externally loaded jpegs. It flashes "out of place" then centers quickly. I'm trying to keep it invisible until it's fully centered. I'm under a deadline so any quick help is greatly appreciated.
Here's what I got:
in the actions layer:
function preloadF() {
if (_root.empty_mc.getBytesLoaded() == _root.empty_mc.getBytesTotal()) {
onEnterFrame = function () {
if ((empty_mc._x=picContainerBack._x+(picContainerBac k._width-empty_mc._width)/2) && (empty_mc._y=picContainerBack._y+(picContainerBack ._height-empty_mc._height)/2)) {
clearInterval(preloadI);
delete (this.onEnterFrame);
empty_mc._alpha = 100;
} else {
empty_mc._x = picContainerBack._x+(picContainerBack._width-empty_mc._width)/2;
empty_mc._y = picContainerBack._y+(picContainerBack._height-empty_mc._height)/2;
}
};
}
}
on my button:
on (rollOver) {
_root.empty_mc._alpha = 0;
preloadI = setInterval(preloadF, 100);
_root.empty_mc.loadMovie("largeImages/image01.jpg");
}
What am I doing wrong or need to add?
Dynamic Loaded JPEG > BitmapData?
EDIT: Simplifying post
code:
var bglinkageId:String = "bg";
var tile:BitmapData = BitmapData.loadBitmap(bglinkageId);
The above code sucks an image already in the library into BitmapData.
As I want to dynamically load the jpeg instead of having to update the library I have loaded a JPG into a new MC named "tile_mc".
My question is how do I get the already loaded (and hidden) MC into 'tile' (BitmapData).
Any help at all appreciated, I have searched.
Thanks
Align A Jpeg Loaded Using CreatePopUp()
I posted this question in the components section....
perhaps that was the wrong place.
I'm using createPopUp to load a bunch of JPEGs of different sizes into a window of a fixed size.
I want the images to always be aligned to horizontal centre.
Also.. the paths for the images are from an external XML file.
Question is.. where do i state how i want to align?
My actionscript is...
Code:
function showWindow(params)
{
my_win = mx.managers.PopUpManager.createPopUp(_root, Window, true, {closeButton:true, title:params.label});
my_win.createObject("ScrollPane","my_pane", 0, {contentPath: params.zoomImage});
my_win.my_pane._x = 3;
my_win.my_pane._y = 31;
my_win.setSize(window_width, window_height);
my_win.my_pane.setSize(window_width-6, window_height-35);
my_win.addEventListener("click", wlo);
popup_opened = true;
setMousePointer("normal");
}
and my contentPath in my XML file is:
Code:
<pages>
<page>images/01.jpg?zoomImage=images/01_b.jpg&label=Page 01</page>
</pages>
Any help would be great
Drop Shadow On A Loaded Jpeg
can anyone help me out with how to apply a drop shadow to a jpeg I load into an empty mc using actionscript?
an example would be great!
thanks mark
Fading Between Externally Loaded Jpeg's
Hi,
I am having problems with a site I am building which I can't figure out.
Here is what I need to do...
I have a movie that when run loads a jpeg into a blank movieclip. There are then 3 buttons on the stage that when clicked load a different jpeg in to the blank movie clip.
This works fine but I now need the images to fade between one antother. In other words, when the move runs the first default image needs to alpha up, then when the next button is clicked I need this image to alpha out load another image and then alpha this new image up.
I have been working with alphaing the blank movie clip to 0 then loading the new image and then alphaing the blank mc back up but I am having no luck and I am assuming that this is not the way you would/should do this.
can anyone help or point me to a tutorial that would explain this to me with big pictures and simple words as I am fairly new to AS.
Thanks
Steve
Buttons Flicker With Loaded Jpeg
Hi,
I have a jpg that is loaded over buttons. Where the two overlap the button doesn't work correctly. It flickers until the mouse is moved to an area in the button where the jpg is not loaded.
I think it's conflicting levels, but in AS3 there are no more levels. So how would I get the content to be on it's own "layer/level"? I tried addChildAt with no success.
Thanks
Tara
Resizing Externally Loaded Swf/xml/jpeg
Hey,
I was wondering, after looking into loading external images via xml- how you would control the size of those images on resize and on first loading.
Do you define the size of the container mc?
Can you apply the same or similar onresize code as you would when applying it too images on the stage?
Any ideas, directions or tutorials would be helpful.
No fla. file as it's just and inquiry.
Thanks,
Chris
Scaling A Dynamically Loaded Jpeg
I've had a good look through the forums but can't find any specific help on this topic. I hope I'm not duplicating a question if I missed something.
I have created a slide show for a selection of photographs which dynamically loads a jpg into the swf to save on load time at the start. I have an alpha fade between each image which works fine but I have a scaling issue. I have a caption button which slides in a bit of text for the photo and shrinks the photo to make room. The jpg is loaded into a movieclip using actionscript and then scaled again using actionscript. The scaling results in distortion lines and isn't as smooth as I would hope for. Does anyone know of any workarounds for this?
The link to the site is http://www.ethos-uk.com/matt/
Thanks in advance for any help
Matt
p.s. The site is obviously not finished
Preloader Externally Loaded Jpeg
Hi
I know how to do a preloader for swfs that are loaded externally,but
if i want a preloader for a dynamically loaded external jpeg, do i just target the prelaoder to judge the propeties of the target movie clip that the external jpeg is being loaded into?
i have tried this method and have had varied results maybe i m doing something wrong)
Thanks
Michael
Moving A MC With A Centered Loaded Jpeg
I'm trying to accomplish 4 things in one. Not sure if it's possible.
1. load dynamic jpegs of unknown dimensions
2. allow loaded jpegs to display at their normal size
3. MC always positions itself so that all images share the same center point
4. Move the MC from right to left
OR to be quicker:
load jpegs from a directory (known image names/ unknown dimensions),
Center them along the Y axis,
Scroll them from right to left.
I pretty much had this figured out and complete using one of Jesse's tutorials he posted. It centers the MC perfectly but causes Flash to disable further execution of actions whenever jesse's code is used more than once on the stage even when it's in another a movie on another level. Therefore, I get my MC to position exactly where I need it to and then scroll perfectly until it gets to the next MC that needs to load a pic.
I did a slideshow using tweens and imported images (not dynamically loaded). So I'm trying to make a more streamlined version of it. Here's the original version: Click Here to view the slideshow.
Any takers?
Moving Loaded MC (ie, JPEG) To New Co-ordinates
Hi All,
I have made a flash movie as seen at http://www.coffeemamma.com.au and would
like to change the following:
I'd like to generate three random numbers from 1 to 5 inclusive but I want
to ensure that each number is different - e.g. 2, 4, 1 (not 2, 4, 2). I know
how to generate ONE random number, but I'm stuck on comparing them to see
whether they are the same (and if they are, then generate new numbers until
they are unique).
With the three numbers I would like to load images based on those numbers -
e.g. '_image_2.jpg' then '_image_4.jpg' then '_image_1.jpg'. This part is
fine IF I can generate the numbers.
I'd also like to have the images come to the front when they are hovered
over with the mouse and then to go 'back' to their original position when
the mouse moves away. This I'm completely stuck on.
I'd also like to be able to put the newly loaded images into certain
positions (as per the example) rather than only loaded to (0,0) coordinates.
I also want to be able to have the images masked as they come in (as per the
example) in order to avoid white corners on the top images.
I also have a page as per http://www.wasabi.org.au/wodonga.shtml which has
some of the functions I want to use, but I can't seem to get some of the
functions working in my new movie...
Many thanks,
Bruce
Transparency In A Loaded JPEG Image
Hi there,
Im quite new to the ActionScript scene so apologies if this question has already been answered elsewhere. I am creating a 2d shooting game, and Im loading multiple images of various enemies from several jpg files, but when I display these on screen the images have a big black square round them. Now when I am programming in another language such as OpenGL, if I wanted to get rid of this I would enable an alpha blending function and set 100% transparency for the black colour which I want to hide. So I load the jpeg file and store it in a BitmapData variable, and then I copy this into a new BitmapData variable with transparency enabled and set to 0x00000000 (fully transparent black). I thought this would solve my problem butt no joy. My code is shown below:
public class GraphicsLoader extends Sprite {
public var loader:Loader; // The bitmap loader
public var bmp1:Bitmap;
public function GraphicsLoader(path:String)
{
// Create the loader
loader = new Loader( );
// Register to be notified when the bitmap has been loaded
// and initialized
loader.contentLoaderInfo.addEventListener(Event.INIT, initListener, false, 0, true);
// Load the bitmap
loader.load(new URLRequest(path));
}
// Triggered when the bitmap has been loaded and initialized
private function initListener (evt:Event):void
{
var img:BitmapData = Bitmap(loader.content).bitmapData;
var canvas:BitmapData = new BitmapData(img.width, img.height, true, 0x00000000);
canvas.draw(img);
bmp1= new Bitmap(canvas);
bmp1.x = 450;
bmp1.y = 100;
addChild(bmp1);
var bmp2:Bitmap = new Bitmap(canvas);
bmp2.rotation = 45;
bmp2.x = 50;
bmp2.y = 100;
bmp2.scaleX = 2; // 200%
bmp2.scaleY = 2; // 200%
addChild(bmp2);
}
}
I think my problem may be that JPEGs dont store an alpha channel so I presume I would have to create an alpha layer in Actionscript, but how would I combine this with my image to remove the black background?
Its doing my head in because I know it should be a simple task but I just cant get it to work. Any help or advice would be greatly appreciated.
Thanks
Robert
Resizing An External Loaded Jpeg
I loaded an external images. It shows ok, but I can't resize the image... Here's my code, please help!
Code:
_root.createEmptyMovieClip("fotonews", 2);
loadMovie("../news_picture/images/001.jpg", "fotonews");
fotonews._x = 35 ;
fotonews._y = 38 ;
fotonews._width = 188 ;
fotonews._height = 145 ;
Thanks in advance!
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
How Come External Loaded Jpeg Bad Quality
how come my external loaded swf is very bad in quality?
im talking about the jpegs.
is there a way to adjust the quality or should i convert it to graphic instead of movie clip, or don't convert it at all
Resizing An External Loaded Jpeg
I loaded an external images. It shows ok, but I can't resize the image... Here's my code, please help!
Code:
_root.createEmptyMovieClip("fotonews", 2);
loadMovie("../news_picture/images/001.jpg", "fotonews");
fotonews._x = 35 ;
fotonews._y = 38 ;
fotonews._width = 188 ;
fotonews._height = 145 ;
Thanks in advance!
Width Of Loaded Jpeg Unretrieveable?
hi,
I'm trying to load an external jpeg into an empty movieclip and retrieve the width and height of this jpeg for later use. Somehow this doesn't seem to work. Does anyone know what's the problem with width & height for me here?
My code:
var picturePath = "test_afb/theImage.jpg";
createEmptyMovieClip("drager_mc", 50);
drager_mc.createEmptyMovieClip("picture_mc", 51);
drager_mc.picture_mc.loadMovie(picturePath);
var origWidth = drager_mc.picture_mc._height;
trace (origWidth);
thanks!
schm
|