ActionScript 3.0 :: Find Out Dimensional Of Loaded Image?
Jun 25, 2009I have loaded image file . I want to find out width and height of desire image. [code]...
View 1 RepliesI have loaded image file . I want to find out width and height of desire image. [code]...
View 1 RepliesI have loaded image from a folder and placed in a movieclip.I can able to resize the image like
ActionScript Code:
mc.scaleX = 0.5
mc.scaleY = 0.5
Now, I need to find the height of the movieclip.
What I want to happen is a movieclip of text aligns 20px to the right of the loaded img, similar to what padding does in css, the code I am using is: textFields._x = (picture._width+20); textFields is the movieclip of text and the image is loading into picture
What actually happens is the the text aligns to picture._width but before the image the image has loaded or I am not telling it the right place to look for ._width
I'll include the .fla in for convenience
I am trying to add a image to the container but am having problems. The image variable is loading fine but not attinching itself to the empty MC I have on the container.
[Code]...
I have a question that's been daunting me for quite a while. I've found a way to do this (kind of bootleg) however I'm wondering a way of better executing this.Scenario:I'm loading an external XML file, with numerous items. Each item has it's own 'description' tag. What I'm trying to figure out is how can I more properly execute this:- Find multiple keywords in all loaded items, if I find any of the selected keywords how can I fire off a separate function to my project (Example: If I find the word "hamburger" in one of the lets say, 54 loaded entries, how can I tell my flash project "if you find "hamburger", hamburgers = 1). Same thing goes if I find "hamburger" within 4 xml items, and "hotdogs" in 12 of the entries making flash know hamburgers = 4 and hotdogs = 12.
My predicament really is on ruling out numerous incorrect amounts. Example, If one xml item has hamburger three times, and another xml item has hamburger only once, getting only one valid "hamburger hit" (that was cleaver terminology, wasn't it? ) instead of three hits for that one xml item.So, I'm trying to let flash know, if you notice "hamburger" once, and only once in an xml item, stop counting the hamburgers, and the item's hamburger value is only 1. If the item has no keywords (example, hamburgers, hotdogs, watermelons, soda, blah blah, (lets say a total of 30 keywords) ) do nothing and do not count the item and move to the next for keyword function searching.
I have a symbol being loaded in through my XML file and its not being displayed. I am using Verdana, I have characters embedded and Ive even tried adding � to the include these characters section and still no luck.
View 9 RepliesHow can I find the width of an external jpg BEFORE it's been loaded into my movie? I can easily find the width of it AFTER loading by loading it into an empty movie clip and returning the width of this AFTER the jpg has loaded using the _width command. But what I want is to find the width BEFORE loading.I have tried "trace(1.jpg._width);" but this returns undefined, obviously as 1.jpg is not an object from my library, it's an external file. Any other ideas anyone?!
View 1 RepliesHow do you detect the end of the loaded swf that loads the flv? It never reaches the frame 20, and I think it is due to the loaded flv CamTest.flv file. So how do you find out that the loaded swf really reached the end? How do you find out the end of the loaded flv inside the loaded swf?
On mainline frame 1, I have
loader_mc.loadMovie("CamTest_controller.swf");
On the loader_mc movie clip
onClipEvent (enterFrame) {
[Code]....
I'm using MovieClipLoader to load in external swfs so that I don't need to include a preloader on each one. I'm really unfamiliar with this technique, including how to use and implement listeners and follow the functionality after using it, I've just been playing with borowed code.basically i've been trying to use this code:
Code:
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
[code].....
I downloaded a tutorial fla file and it contains 2 images of cars which seem to be under a folder called "bitmap assets" seen in the library panel. Now, since i have not created them, is there a way for me to somehow access them directly?
View 2 RepliesI've never tried to do anything like this. Basically what I need to do is scan an image and blur the part that resembles a certain shape. For example: blurring license plates on cars or pictures with other people in them in which they should be blurred. I've done some googling and not found anything close to what I'm looking for.
View 4 Repliesi have a gallery of images, 4 galleries actually. I have thumbnails that pop up for each gallery. I want to find out how to detect which thumbnail is being selected so i can load the appropriate image.
Code:
var picNum:Number
picLoad.load(new URLRequest(myXML.Gallery[galNum].Image[picNum].@picURL));
stage.addChild(picLoad);
[Code]...
I have an image that has call out bubbles in it (call out = comic book text bubbles - i didn't know they were called that). I need to find where each of these are in a given image and get the location and size of each of these.
AS3, Flex, Bitmap
Some images I load dynamically are too big so I would like to scale them to fit the stage.
[Code]...
this returns 0. Why does it return 0 when the image loaded is obviously much larger then 0 pixels. How do I change the width and height of imgCont to a specified dimension.
I am dynamically creating a 2 movie clips in a class. in one movie clip i am loading the image using MovieClipLoader. everything is working fine. but the onLoadComplete method is not working properly. i am using onLoadComplete method to find the width of the image but in onLoadComplete event the exact width is not calculating
[Code]...
This should be rather simple, but for some reason i'm only able to find methods to just diplay a random image, but i want the image to change once a day not every time you load the page.
All i have atm are a empty movieclip to load the photos, an upload system in flash that uploads photos to a specified directory, but now i have to figure out the AS to make the movieclip load a random photo from a specified directory once a day.
I have my main swf (swf1), that loads another swf(swf2). At some point, swf2 loads an external image. What's the best way for swf1 to align the loaded image from swf2??
View 2 RepliesHow should I go about cloning an image loaded form the server and adding it to the end of the first image loaded? Would I use bitmap clone? My attempts with this failed[URL]
Code:
//Creates new image loader
var imageLoader:Loader;
[code].....
I'm working on my website which is a portfolio site, to showcase my work I have a basic XML image gallery which does 1 of 3 things loads a large photo, goes to a frame with a video player, or goes to another frame with a gallery of web design or flash work i've done. when a thumb is clicked i trace the indexOf(event.target) of the thumbnail clicked (all thumbnails are placed into an array).
the problem is that for some reason randomly the index will not be found and return -1, but then other times it will find the correct index and work properly. i don't know what the inconstancy is thats causing this to occur
want to get the loaded image path location,how to get the path
<mx:Image source="@Embed('assets/image001.png')" x="240" y="41" width="148" height="118" id="img"/>
i need to get this address source="@Embed('assets/image001.png')" how?
I want a bubble chart that just shows items along a straight line. So I'd like the horizontal axis to essentially not exist. I have it working right now with the yField assigned to a field that happens to always be '1' on my test dataset.. but this is not going to be the case in general, so I need some way to restrict the y-axis... preferably without needing to go back to my model and parse through all my data to add a dummy value '1' on each entry.
Unfortunately setting min/max values just cuts off anything above or below rather than restricting entries.
I set computedMin and Maximum (no idea what they are and the docs don't really explain) but it didn't seem to restrict the data in any way.
I have this as xml :
[Code]..
I wanna parse it and install it on in array or an object how do i that?
I am trying to replace some code which loaded an external image and triggered and function once completed with code that uses and embedded image. The relevant code looks like this.
Code:
[Embed(source='globe.png')]
public function Globe()
{
var imageLoader:Loader = new Loader();
[code]....
The commented out section is where it used to take the loaded image and apply it to a texturemap.I need to replace the lines of code in the first function with something that calls the second function correctly.
I have tried using function imageLoadComplete (e:Event = null)and calling it with imageLoadComplete(); in the first function but although it compile and runs without error, the program does not work properly. I suspect this is to do with the dispatchEvent(); line which I do not understand.
have a twodimensional array that consists of 6 other arrays(like array[0 to 5][0 to 4]). The [4] of each sub-array is a indexnumber that i'd like to use for sorting the array[0][x] toarray[5][x] according to their array[x][4]-value. How would I do
View 3 RepliesI couldnt find how to form a 2x2 matrix as old pascal days in ActionScript. All arrays are only one row. How can I change it.
View 3 RepliesI am currently playing around with flex, I have C++ background, so I am not used to AS3.The problem is in the main*.mxml file I have fx:script block and I try to define a multidimensional array like that:
public var Board:Array = new Array(25);
I use a function to initialize the 2d-array:
public function initBoard():void {
var i:int;
var j:int;[code]....
This function gets called later on in the main loop to init and reset the "board" why doesn't it work. The only difference to the AS3 documentation is that it gets done in a function.
[code]...
How can I sort the two-dimensional array superHeroes by the "city" or [1] value?
How do i traverse multidimensional array so i can turn this into value objects :
Code:
<accordion_nav>
<item branch="PATIENT TYPES" level="1" treeID="10.00">[code]......
so each items has a propery of branch, treeID, and level?
i am amuthavalli. i am new to the action script. so i want to know how tho define and access the two dimensional array in flash
View 1 Repliescreating If loops with multiple-dimensions. What I am trying to do is simple in concept: create "boxes" (square movie clips) surrounding another movie clip (one to the left, to the right, above and below). Essentially what I have so far looks like this:
--------SQUARE-------
SQUARE-Center-SQUARE
--------SQUARE-------[code].....
The problem with this is that as soon as I use the function createmoresquares, the for loop is run again for that second set of squares, but the original for loop to create the original set of squares is forgotten so that I end up with this:
----------------SQUARE--------
--------Center-SQUARE-SQUARE
----------------SQUARE--------
I know this all seems very confusing but the basic mistake I am making should be easy to resolve. I have the same problem creating multiple-dimensional arrays.