ActionScript 3.0 :: How To Trace Width Of Loaded Picture
Feb 23, 2009Can I trace the width of a loaded picture? I thought it would work something like this, but it won't work..
View 5 RepliesCan I trace the width of a loaded picture? I thought it would work something like this, but it won't work..
View 5 RepliesI need to know the width of a picture I load into a clip. But I always get Zero, while I see the picture properly loaded. What Am I doing wrong in this piece of code ?
[Code]...
Under what circumstances would you not be able to trace a movie clip's width or height but be able to trace it's x & y? When I try to trace the mc.width or height it outputs 0 ???
View 3 RepliesThis is an easy question but don't understand why this isn't working. I'm trying to trace the width property of a shape object. do i have to convert it to a number?
[Code]...
I have a dynamic text box on my stage that is 400px wide. The text box is being populated with flashvars data from an HTML file and auto-sizes (myTextBox.autoSize = TextFieldAutoSize.LEFT) so it will display all content by expanding when the text spans over 400px. But when I trace 'myTextBox.width', it always returns '400'and when I trace 'myTextBox.textWidth' it always returns '0'no matter how much text I push into it through the flashvars.
This is because the trace is only tracing the previewed swf in Flash which has no ties whatsoever to the HTML file and flashvars.Therefore, when previwing the swf, my text box is always empty.The only way to see the content populating the text box is when actually launching the browser with the swf embedded in it.Because of this I cannot seem to be get flash to 'do things' based on the new width/textWidth values of my text box after it has been populated with the flashvars data from the HTML file.How can I get flash to detect the new width/textWidth of my text box after it has been populated by the flashvars data from the HTML file?
I'm trying to trace the width of the actual text of a dynamic textfield (called 'label'). i know this should be
code: trace(label.textWidth);
however, all I get is an 'undefined' message in the output box. Whereas, if I trace(label.length) instead, then it counts the number of digits in the text field. I thought label.textWidth would work? I want to find the length of the text in pixels basically...
Code:
//p is movieClip
var p:pic = new pic;
var bmpData:BitmapData = new BitmapData(p.width, p.height);
[Code].....
when I compile, flash draws only half of the width of my picture, can any 1 tell me why? my fla file is bigger than 500KB so I can't attach ;(
I wanna make a border around my picture gallery and I am loading throw thing function. I wanna know the pictures scaled size is there a way for that ?
Code:
Select allPictLoader2.scaleContent=true;
var fl_Picture__2:URLRequest = new URLRequest(FolderName+"/img"+Broj2+".jpg");
PictLoader2.load(fl_Picture__2);
How can I create a button to control the width of a certain picture by just sliding the button on a scale in Flash 8? (I've found the actionscript for the button in a sample file in Flash MX. It looks like this:
onClipEvent (load) {
initx = _x;
left = _x-50;
[code].....
Pretty much said it in the title. I have drawn a cartoon in flash (cs4) and because of zooming in and out my lines are different widths (thicknesses?)
Is there any way I can select the entire image (just lines) and somehow "uniform" them?
i am trying to make this xml gallery that dynamically resizes according to the picture's width & height. the function resizer() is hardcoded with fix values. i have tried to assign it from the array like below but it works wierd, the border just keep increasing in size.
Code:
menuHolder["but"+i].onRelease = function() {
imageLoader.loadClip(this.path,gallery.imageHolder);
gallery.imageBorder.tween("_width",this.width,1,"easeOutExpo");
[code]....
I want to make a picture gallery and use buttons that move you from picture to picture and backwards, but I don't want to tell button 1 to go to frame 2 and button 2 to got to frame 3 and so on (I hope you know what I mean)Can I use on button on a separate layer with the same action set? I tried something like that, but it didn't work:
on (release) {
thisframe =+1
}
[code]........
but it didn't work. I'm kind of new to any action script other than gotAndPlay, easy functions and all that.
Is this possible? I need to add a Click event to a button (actually several) in a swf that I've loaded. Is this possible? I'm currently trying to trace the objects but getting nowhere.
View 5 RepliesLine 1 Frame 1:
[Code]...
I am trying to trace the results of my listener when the browser is resized...no avail. Are you able to see what I am doing wrong?
Trying to get a MovieClipLoader to work for me... This code is taken pretty much right from Macromedia's Help file. I get no error messages (yay), but I also get no trace statement (boo) or loaded clip (boo2). There *is* a clip named audioplayer.swf in the same directory as my file.
[Code]...
I need to establish size of picture (*.jpg) loaded in swf file. I used this script for load the picture:
_root.createEmptyMovieClip(picture, 9876);
loadMovie(obrazok.jpg, 9876);
trace(picture._width);
but traced number is always 0 however the real size of picture is 256 x 192. How should I change the script for it works?
how can i resize the dynamically loaded pictures: i have around 100 pictures, and i don't have the time to make thumbnails from every picture. i'm thinking to change the image size to display the thumbnails.In the xml i want to put only the <image>the link of the picture</image> code, and in flash i want to resize this image that will be displayed in the thumbnail scroller.
View 4 RepliesHow do I center dynamically loaded picture?[code]...
View 3 RepliesIm trying to make a slideshow in flash, but i want to be able to change the pictures in the flash file, by just uploading new ones to a FTP server, with the right names and resolution..
View 3 RepliesThis is a webpage, where I use a modified gallery from tutorial (xml galllery with thumbs).This place is where I align picture movieclip in the center of area (which is also a mask).Sometimes, action clip doesn't get image _width and _height and load a picture with it's left upper corner in the center of mask movieclip. When I click again on thumbnail - image loads already perfectly how it should be centered. What can be the problem? maybe I missed something?Here is a modified code of the gallery:
Code:
stop();
function loadXML(loaded) {
[code]......
In my following code "Btn.onRelease" doesn't work after "LoadImg()" was call, How can I solve this, because I want to detect a click on Btn once the new picture was loaded.
Here is my code :
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
function LoadImg() {mcLoader.loadClip("images/p0.jpg", Btn);
}LoadImg();
Btn.onRelease = function(){trace("onRelease");
};
How can i rotate a dynamic loaded picture around a point i define?
Now my pictures are rotating around the upper left corner, but thats wrong, i need it to rotate around the center.
I am having an issue with pulling width and height from an external swf.
I can load it ok, and place it ok, but I want to shrink it when I place it and that is where the problem occurs. Here is the abridged code. The odd thing is that if I move the width and height lines inside the function, it works. Trouble is every time you click that tab the swf shrinks a little more.
Code:
//------------------Calling the external SWF and loading it-------------
var myRequest:URLRequest = new URLRequest ("images/filter.swf");
var myLoader:Loader = new Loader();
[Code].....
I've been scouring the internet for the past hour or so in search of how to do this. It's very simple, but every example seem to want me to bring a loaded movie clip, or trace mouse position. I don't need that! Basically I have a button that when clicked comes to the front (using behaviours), moves to a new position, scales and then I want every other button behind it to blur. Obviously I want them to blur gradually to keep the flow going. Here's my current code so you can see where its going:
[Code]...
is it possible to get the width of a loaded movie? for example:-
Code:
_root.createEmptyMovieClip("pic", 1);
_root.pic.loadMovieClip("pic.swf");
trace(_root.pic._width);
From the code above, my trace outputs (0), ignoring the width of the loaded pic.swf, has anyone ever encountered this or a way around it?
Is there any way to get the real stageWidth of an loaded swf? The problem comes when the loaded swf has some elements outside the scene. In this case content.width becomes bigger then the scene. My code looks like this:
[Code]...
I have created some movie clips dynamically using createEmptyMovieClip. Then I am loading images into the clips using the MovieClipLoader. In the onLoadComplete of the loader I am trying to position the clips based on the _width and _height.
I would think that since the clips are loaded as indicated by the OnLoadComplete firing they would have a _width, but it comes up as 0. What gives?
I have a simple gallery where I'm loading thumbnails from an XML file.
The thumbnails are loaded into a containing MC (thumbCon), I want to be able to space the thumbs using the width of the thumbs.
How do I capture the width of the loaded thumbs?[code]...
Why is this not working?
ActionScript Code:
var ld:Loader = new Loader()
ld.load(new URLRequest("bi.swf"));
trace(ld.width);
addChild(ld);
It loads and is added just fine. But I need to know it's width in order so that I can center it better.It says that the width = 0?and if i do this...
ActionScript Code:
var ld:Loader = new Loader()
ld.load(new URLRequest("bi.swf"));
addChild(ld);
trace(ld.width);
I get the same result that the width is 0?
I am loading several movies into a main movie. I'm using moviecliploader class.loadMovie with a listener object.On LoadInit sets the dimensions and position of the loaded movie.With one of the movies this works fine, but with the other, as soon as I set the width, the movie disappears and on tracing the width following setting it it turns out to be 0.I've just returned to actionscript after a month and I have a memory like a sieve. I'm sure I remember this happening before but I can't remember what I did.
View 1 Replies