ActionScript 3.0 :: Unable To Make An Image As An Object On The Canvas
Apr 30, 2010
I have an app wer i drag and drop images onto a canvas and then move them on the canvas to arrange them appropriately. After that i shud be able to click on those images and draw connectors between them as the user seems required. But after dragging and dropping the images on the canvas and arranging them, when i click on the image i am getting a typeerror 1009 error, i.e, "cannot access a property or method of a null object reference".
Actually after arranging the images, i add an event listener to the image(proxy) on the canvas:
I'm trying to skin a canvas with an image (which is essentially a custom border for the canvas). I've been trying the backgroundImage style as well as the borderSkin style. I can't get the image to scale to the full size of the canvas though. I was wondering what the best way to go about this is.[code]...
So on the focus change i want to run the "end_preview_on_focus_change()" but this is not working. As per my understanding, i think the canvas not getting any focus in the first place. I was trying to use focusManager.setFocus to do that after the canvas's creation complete. but even that is giving me an error.
In my application a canvas object has height = 90 px & width = 86400 px (indicating number of seconds in a day [60 * 60 * 24] ). The canvas is scrollable and the user can add or delete components in that.Now, I want to have snapshot of the whole canvas & shrink it to size 910x30 to draw taken snapshot in another canvas.Can anybody tell me how to take snapshot of such large Component?I have tried to take snapshot in BitmapData object but as it max width is 2880 can not give whole canvas snapshot.
I am trying to make a flash application that can save (to the user's local hard drive) a screen shot of the canvas (or more accurately part of it).I've dabbled with Quasimondo's Bitmap Exporter which did some funky stuff to render an image, ship it to a php script on the server, and bounce it back to the client. But not only is that inefficient it also has two other major flaws:
1) it's written in actionscript 2 so I can't use any actionscript 3 abilities.
2) it breaks as soon as one of the images on the stage is defined as a variable brought in through $_GET rather than hard coded. (the image comes in fine but then the rendered finished product is a blank white image)
I am able to drag a copy of an object and drop it on the canvas, using drag-drop manager functionality in Flex.
The original object remains unchanged and a new copy of the object is created. However, If i further want to drag this copy and position it differently on the canvas, I find that the object is not draggable.
Since this copy is created at runtime, I am not sure how I can achieve to drag it? [code]...
I'm creating a flash fun thing where you dress up a character by just dragging and dropping little images, everything is working fine.
I want to add an option to save the image you have created, I can do this but the problem is you have to set a movie clip to capture, the thing i want to capture is a few movie clips layered on top of each other(the finished character).[code]...
I am going nuts! I have a canvas which I am trying to add a background image to. I am not setting the Y position, but after I add it to the canvas it always starts about 40 px down. If I trace the Y position it still says 0, even after a timer. I have tried to move it to the parent canvas and got the same results.
I'd like the Image not to overflow the bounds of Canvas. But when I set width and height on the Canvas, my Image disappears. Canvas also doesn't seem to respect horizontalScrollPolicy.
Seems easy enough, but as the official Flex documentation is down at the moment, I thought I'd turn to SO.
I am new to flex, and do not know how to add an image (or other ui component) to canvas, so user can select it (and see that it's selected), also I want to add a possibility for example to click backspace and remove selected image from scene. How to do that?
I have an image loaded from an url and added to canvas as child. Then I am drag and dropping another image on it which also uses the senocular transform so the image can be transformed on the canvas. I have coded in such way that the transform handles shows up only after it's dropped on canvas. The image shows up correctly. But I am trying to save the result image (that is the main image and the dropped image on top of it), I only end up with the main image that was loaded earlier. The dropped image doesn't show up.
Below is the code for handleDrop() that is fired on dragDrop event and prepares the final image.
I'm trying to make an interactive quiz show type thing. The video shows someone reading the questions, then the answers appear as four clickable images after the question has been read. Then a user clicks on an answer it updates the score and moves to the next question.
Video has been imported and it plays perfectly. Movie controls (Play, pause etc) work fine as well. But since the video doesn't appear in the flash timeline (but in the external FLVplayback component) how can I get the images for the answers to appear on the screen at the right time? I have to use the FLV playback for a number of reasons so I have to find a solution to this problem within that context.
I put in navigation and event cue points in the flash video encoder first, the idea being to have the video pause at that point and make the buttons appear then, but I'm getting constant errors with everything I try.
(I believe you use event listeners to wait for the cue point and then use addChild to put in the video, vid.pause(); to pause it but I'm just getting tons of errors every time I try anything like that so clearly I don't know my syntax well enough)
I want to dynamically add different items to thumbContent canvas and use scroller canvas to scroll. I see than the height of thumbContent bigger than 7977 it truncate from scrolling. So - I see the scroller canvas with empty space on top. Then I scroll to bottom - I see the content of thumbContent and at bottom scrolling I see empty space too.
I know that the question may seem very easy. I am trying to display an image on canvas.I need to do it in AS, and also I need to locate image in specific coordinates.
im trying to create a online business card editor to learn flash again, one of the functionality im trying to achieve is being able to upload an image (jpg,png etc) and place said image onto a drawing canvas and then being able to scale the image and rotate the image and move the image around. can some one direct me to a decent tutorial for this kind of functionality.
As part of requirements for a new feature of "locking" a page, it is desired to have all elements on a locked page be non-selectable. This is not to be confused with disabled. All elements should appear as if the page were active, but not be selectable.The current thought is to create a clear canvas and place it over the existing elements. With this thought, I have two questions:if you can think of a better way to make all items non-selectable than applying a clear canvas element over the existing elements could you describe it?if not, what is the best way to retrofit existing implementations to accept the overlayed canvas item? BTW, all .mxml pages inherit from a custom .as file.
I made a pact that I'll use only AS3 from now on but.. The tweening class is confusing me. Take a look at this: [URL]. Finding code that will make the earth move down into center of canvas and simultaneously grow larger?
I am currently working with a Canvas object on which I am drawing curves using the curveTo() function of the canvas' corresponding Graphics object.The following animation is being performed on the Canvas object's scaleX attribute.<mx:AnimateProperty property="scaleX" fromValue="1" toValue=".5" duration="1000" />At present, this transformation is also scaling the line weight down by some arbitrary value. Is there any way to perform a scaleX transformation on the Canvas without it modifying the line weight of the lines drawn in the canvas?
I need the exact simple application but the ability to choose a background image from a file on the server as the canvas and I want to save the created image on a server file instead of on the client machine. The ability to change the pencil drawing size would be an additional plus. I work with php and mysql so I would like to use them to store the file parameters, even as a blob in mysql, along with some additional user (server) defined variables (I can do the php/mysql side if I can get the file there, I understand there is an swf to png ByteArray class that might be able to save on server. The project is for an opensource group so the final product would need to remain as such, I would be able to pay for the modifications mentioned above. The source files are available at the links below. [URL]
I made a program in Flex that uses the actionscript 3 drawing api. I am drawing on a Canvas and on every mouseUp event I save the bitmapData in an Image component and clear the the Canvas. That works great, but the problem appears if I want to add a background to the paint that was drawn.
Here are the mxml components: Code: <mx:Canvas id="_backgroundColor" width="100%" height="100%" x="0" y="0" /> <mx:Image id="_image" x="0" y="0" mouseEnabled="false" /> <mx:Canvas id="_paper" x="0" y="0" />
And here it is the function I have on the Canvas (_paper) mouseUp Code: private function onSaveModifications(evt:PaperEvents):void{ var bmpData:BitmapData = new BitmapData(this._paper.width,this._paper.height,true,0x00FFFFFF); bmpData.draw(this._paper); this._image.source = new Bitmap(bmpData); this._paper.graphics.clear() }
I want when I set the _background Canvas background color to see it, but I cannot because the Image component(_image) where I save the bitmap is masking it.
This is how I set the background Code: this._background.setStyle("backgroundColor",0xff0000) Do you know how can I make the pixels of the bitmap that weren't drawn to be transparent?
I am unable to get the exact look when i replace the image with new image.I took one sample program. In this one image will be rotating. I tried replacing this image with new one, but it's not working as old animation.(Actual Old animation is some thing like Moving a needle, after replacing the image with new one needle is rotating some thing like along the boundary of circle. I am unable to find the root cause and solution.I didn't changed any thing in the code.)How to get the smooth rotation?
My artist drew a beautiful island but it's 5000 in width. We scroll it as it's for a Virtual World. - it's in layers and we scroll the different layers at different speeds. Flash documentation states that the limit is 2880 BUT it does work in the player i.e.: you can see the full island but it does run a little slow.
Should I a. Create a smaller island of 2880 which is a shame as I would have to get rid of a lot of good stuff b. Split it into two images and dynamically connect them with code.
Also, I have different layers scrolling at different speeds which would make things more difficult to look natural.
I'm trying to make a copy of an array filled with Canvas objects. I use this code:
arCopy = ObjectUtil.copy(myClass.myArray) as Array;
What I get is an array arCopy filled with Objects instead of Canvas. Each of these Objects has propersties suggesting that it was Canvas (like uid="Canvas333" or name="Canvas333"), but it's instance of Object class. I've been using ObjectUtil.copy() before but never seen such behaviour.
I have a site that plays either .mp3 or .flv files depending on what is selected from the menu. Menu loads in from xml. I get "unable to make connection with server or unable to find flv on server" when I try to play the video. But the video and audio files are all in the same directory and the mp3 files play fine. I think I'm having a problem with the setMedia command. Here's the code that loads the video and audio files.
I need to underline particular character of the tab header(like Account) A has to be underlined. We are using tab navigator and canvas container controls to create the tabs in our screen( Canvas label has to be underlined).
How to give a ms word like interface to a user so that he can enlarge and contract the display objects like Images, canvas, Hrules etc. at runtime in an web application?