Vector graphics & animation using Flex

Hi,
I want to draw a vector graphics in flex 3 then later on I
need to do some animation on it. But I encounter some problem and I
cannot solve it and I get this error message "1120: Access of
undefined property circle". Thanks... Here is the code:
<mx:Script>
<![CDATA[
import flash.display.*;
private var circle:Shape = new Shape()
var xPos:Number = 100;
var yPos:Number = 100;
var radius:Number = 50;
circle.graphics.beginFill(0xFF8800);
circle.graphics.drawCircle(xPos, yPos, radius);
addChild(circle);
]]>
</mx:Script>

You can declare and initialize variables in a <script>
tag outside a function, but manipulating them must be done in a
function. In this case, having a function for the creationComplete,
or perhaps the initialize events works well.
Also, you can't add shapes by themselves to the app, you must
wrap them in a UIComponent.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
import flash.display.*;
private var circle:Shape = new Shape();
private function init():void{
var xPos:Number = 100;
var yPos:Number = 100;
var radius:Number = 50;
circle.graphics.beginFill(0xFF8800);
circle.graphics.drawCircle(xPos, yPos, radius);
var comp:UIComponent = new UIComponent();
comp.addChild(circle);
addChild(comp);
]]>
</mx:Script>
</mx:Application>

Similar Messages

  • Rendering animated vector graphics

    hi there.
    i did an animated vector graphics - i prepared all vectors iamges in illustrator and animated them in after effects afterwards.
    i am now about to export and i wonder what are the best settings.
    for video i normally use quick time with animation codec and it seems just fine to me. but i am not sure if it is ok for the cartoon.
    what codec to use for storing and publishing on the internet (youtube, vimeo)? what about swf? I red it is used to deliver animated vector graphics (such as cartoons) over the Internet - is that right?

    SWF might be used if the cartoons were created in Flash. Since you've created it in AE, it's not likely to be the best choice for you.
    The Animation codec is a good choice for a lossless render if you've made a cartoon. In fact, I wouldn't use it for anything with video footage and a cartoon is the most likely scenario in which I would use it.
    You would want to take your lossless file and bring it into the Adobe Media Encoder to create your final, web-ready video. There are YouTube and Vimeo presets in the Adobe Media Encoder that you should use for uploading to the web.

  • Flex and Vector Graphics

    Hello!
    How can I use vector graphics in Flex that were drawn in say Adobe Illustrator?
    In the Flash IDE I can just copy-paste on the stage for example.
    Thank you.

    Google FXG graphics for use in MXML.  The newer versions of Creative Suite support exporting graphics in the FXG format.

  • How to Use the Scalable Vector Graphics API (JSR 226)

    im doin an Application with Maps and locations...
    i need 2 use the Scalable Vector Graphics API (JSR 226)..
    can anyone plz guide me to get it and use the API.. Im using netBeans 5.0
    it will be great help :)
    Regards
    Muhammedh aka MNM

    Thanks Rohan :)
    i did read some stuff from the URLs u gav me :)
    and I manage 2 solve the prob i had :) (Thank God)
    1. downloaded latest version of netBeans (5.5)
    2. Java SDK 6 :D...
    3. the key thing: Wireless tool kit for CLDC 2.5 Beta
    now when u create a project make sure u set the above given tool kit :)
    when u set it.. u get an option 2 select the APIs frm a List.. Check on SVG API :)...
    Other APIs Such as,
    * wireless Messaging API
    * Location API
    and many more...
    Cheers 2 Every1 :)
    regards
    Muhammedh

  • Using a vector graphic for a button

    Adobe Photoshop, Illustrator, and Encore CS5, everything is patched, Windows 7 64-bit
    I have been reading various posts, and either not seeing or not understanding something about using a vector graphic as a button on a menu.
    I drew a one-color shape in Illustrator, saved it as EPS and PNG and used it in a menu designed in Photoshop. When I preview it in Encore or burn a DVD, the graphic looks awful. And I'd like to use highlighting with it so it changes color when selected but that is another problem....
    To start the menu, I used the Photoshop preset NTSC DV Widescreen which has a pixel aspect ratio of 1.21. Then I added background graphics and so on. Each button is contained in a layer group named (+)PlayAll, etc. In each layer group is a text layer that doesn't have a prefix (e.g., Play All) and another layer with the vector or PNG named (=1)kv, which is the name of the EPS or PNG file.
    The behavior is fine. The graphic moves to indicate which menu item is selected, the text is constant, never changes.
    In Photoshop, the graphic looks fine but when I preview it in Encore it looks crappy and pixelated. What do I do?

    Part of the problem is I have no idea what some of these terms mean ... "2-bit indexed", ... The first one might mean an object that has one color,
    It is not the same as one color, and yes, it probably means more than any of us intend.  See  Encore help regarding button subpictures, in particular the part regarding using Photoshop to create button subpictures.
    The latter includes "(Technically, the subpicture overlay is a two‑bit indexed image.)," but you don't need to understand the technical meaning (they don't explain it anyway).  You do need to understand the liimitations they explain there,  For example, under "solid colors only," they say "Elements on these layers must use solid colors and sharp edges. Use one solid color per layer. Do not use gradients, feathering, or anti-aliasing on the subpicture layers. Color gradations are not possible in subpictures."
    "sub-picture highlight" ... the second one is probably made up.
    Heh, heh.  Searching that in Encore help (which I often find lacking) finds the page on Button Subpictures.  I agree that some of the terms, whether they are from the DVD specs or Sonic's applications (on which Encore is based), can make it difficult to look things up.
    "vector layer".... I searched Photoshop help for "vector layer" and got nothing. There is such a thing as a vector mask on a layer but I have no clue what a vector layer is.
    You're correct - vector mask.  Within a button group, the vector mask will be part of a layer, so I think of it as the button group "vector mask" layer.  That's part of why I pointed to using a library menu and editing in photoshop so you could compare what you have to what a template looks like.
    Please suggest which Encore library menu I can try. I opened a couple and couldn't figure out how they worked.
    In the General set, pick the Sunset menu.  Edit in Photoshop.  Expand the "(+) play movie" layer.  The "button vector mask" (the dark area) is in the layer called "button."  Notice that it does not have a (=1) or other indicator that it is a highlight.  In other words, it will just sit there, in whatever color is defined, and will not be a highlight.  If you put it in a layer that has one of the highlight indicators (the =1, =2 etc), it will then be subject to the subpicture highlight limitations.
    You might try your graphic in such a non-subpicture layer, and compare its appearance to putting it in a subpicture layer.
    Jeff Bellune's book (he's a moderator here) is still very applicable.  While some things have change, the basics haven't.
    But, hey, Jeff.  Why haven't you updated your book yet?  Inquiring minds want to know!

  • Is it possible to get font names of the used vector graphics?

    Hi All,
    Is it possible to get the font names of the used vector graphics?

    Hello Learner,
    or you could try to read out the fonts from XMP metadata.
    1. Load XMP Library
    2. Read out XMP metadata from file
    e.g.
          var _numberOfFonts = _xmpData.countArrayItems(XMPConst.TYPE_PAGEDFILE,"xmpTPg:Fonts");
          if(_numberOfFonts) {
            for(i=1;i<=_numberOfFonts;i++) {
                _path = XMPUtils.composeArrayItemPath(XMPConst.TYPE_PAGEDFILE,"xmpTPg:Fonts",i);
                _fontFamily = _xmpData.getStructField(XMPConst.TYPE_PAGEDFILE,_path,XMPConst.TYPE_FONT,"fontFamily");
                _fontface = _xmpData.getStructField(XMPConst.TYPE_PAGEDFILE,_path,XMPConst.TYPE_FONT,"fontFace");
                _fontType = _xmpData.getStructField(XMPConst.TYPE_PAGEDFILE,_path,XMPConst.TYPE_FONT,"fontType");           
    Roland

  • Use Raphael Vector Graphics Library in Adobe AIR

    Have you used the Raphael Vector Graphics Javascript Library in Adobe AIR? What problems, pitfalls and challenges have you encountered?
    To the Adobe AIR Team: It would be tremendously helpful and will be much appreciated if you can create a sample Adobe AIR application using Raphael.
    ~Oscar

    Hi again jackson@mja.
    I've given your scroll component a try just for some static texts, and I've found quite a few important bugs:
    1. If the referenced sprite/movieclip is shorter than the scrolling area, it starts bouncing infinitely in a quite funny way,
        which renders the component unusable. Sometimes it even happens when the content is not shorter.
    2. If your component is used inside another sprite/movieclip which is added dynamically from code ("addChild(mySprite);"),
        it doesn't work and stops with an error, because the EventListener for mouseDownHandler is being added to this.stage
        in the constructor, but a dynamic movieclip doesn't have access to the stage while in the constructor step (unless it is
        already in the stage added in the Flash IDE, such as in your FLA example). To fix this, I've added the following code
        to the ScrollArea() constructor:
    this.addEventListener(Event.ADDED_TO_STAGE, init);
    this.addEventListener(Event.REMOVED_FROM_STAGE, close);
        And then I've added the following listener functions:
    private function init(event:Event):void {
    this.removeEventListener(Event.ADDED_TO_STAGE, init);
    this.stage.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
    private function close(event:Event):void {
    this.stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
    3. Also, the scrollbar is only correctly rendered if the scroll area is located at the up and left corner of the stage. To put text somewhere else, the component must be put inside a movieclip.
    4. This is not really important, but I've found the following variables are never user and so I've removed these lines:
    var xy:Point = this.localToGlobal(new Point(this.x, this.y));
    var wh:Point = this.localToGlobal(new Point(this.width, this.height));
    var sign:int = sign(obj[i]);
    I hope this can help you improve your classes.
    Best regards,
    OMA2k

  • Find vector graphics by co-ordinates using itextsharp

    How to find vector graphics by co-ordinates using itextsharp

    This is a forum provided by Adobe for discussing their own products only.

  • Using vector graphics?

    Hello.
    Does anyone know of any instructions or tips for bringing vector artwork into FCE?
    I can't even get the program to recognize and EPS, and while I can import an AI file, it comes in with a coloured background (white, thus making a white logo impossible to use) and it quite pixelated, even when using it @ 100% actual size.
    I have a logo I need to add to a piece I'm working on, nothing complicated, I just need it to scale up over time, and I'm hoping to keep everything in FCE and not have to go into After Effects or Motion, etc. to render out footage for this.
    Thanks,
    Kristin.

    Vector graphics need to be rasterized before FCE can work with them.

  • Reduce file size vector graphics

    When it comes to imported vector graphics are there any methods to decrease the swf's file size as much as possible?
    So far I have:
    - imported an illustrator ai file (strokes 'expanded' in illustrator and unneeded swatches/brushes etc. deleted and with no raster images embedded)
    - exported the file in illustrator as swf and imported that swf into flash
    - imported ai file and breaking it down to flash shapes
    - optimized those shapes as much as possible
    I rather use vector as much as possible. For a banner for examle, I've imported vector images of trees. I couldn't get it below 40 kb so I exported all illustrator files to png files which helped. Can detailed vector images be optimized just as much? Or is it better to use bitmap files when it comes to more detailed graphics? Does it matter if it is a vector images made in flash or a imported vector file even if both have the same number of paths?
    Any other ideas I might try besides the things I've already tried?

    There is a certain threshold when a bitmap can actually be smaller than a detailed vector graphic. Especially when working on small image sizes, bitmaps can often be quite smaller.
    For a vector graphic, you can't do more than reducing the number of vertexes which may result in a poorer graphic.
    With bitmaps, you can do a lot more:
    Keep in mind that bitmaps with an alpha channel use up much more memory than bitmaps without alpha information. So try to reach your goal without using transparent bitmaps - which seems hard in the beginning, but as Flash provides different blending modes, you can, for example use the blending mode "multiply" for a black logo on a white background with just a grayscale bitmap instead of a bitmap with alpha channel information.
    The same is valid for a white logo on a black background: Use the "add" blending mode instead, then.
    I have also written some Photoshop Plugins to reduce the alpha-channel bit-resolution which sometimes gives me the extra 3-4kb I needed. Instead of using 256 shades of alpha, it reduces them to maybe 8 or 16. Alpha-Channels are comressed like GIF/PNG images inside of flash, so having as few different shades of alpha as possible will make images smaller. I even use dithering sometimes for softer alpha areas.
    In some rare cases, you can also gain some bytes if you convert text to vector graphics (pressing CTRL-B twice), but this only works when there's not much text at all. That's because the metric information for text glyphs take up a bit more space then just the shapes. So you can imagine that this may only work if there is just one text element with all different letters. So you won't get much size reduction by converting "abracadabra". But you will get some reduction if you convert "the quick brown fox jumps" into shapes.
    This all can help if you have restrictions like 30kb or even 20kb to create a full animated flash banner.

  • Can we select a particular area in the browser using Flex?

    Hi All,
    Is it possible to select particular area of the flex
    application in the browser using Flex and generate that area into a
    image when an button is clicked?
    Please help me.
    Thanks in advance

    Yes, you should google Flex screenshot bitmap, there are a
    number of examples. As far as 'selecting' one of the examples may
    show this, but you can just use a Canvas or similar for the box
    drawing (set background transparent, and just use the borders, and
    resize the canvas on mouse events). Otherwise you can do the
    Graphics sorite drawing by hand or use something like Degrafa for
    fancier, or look up quasimodo marching ants for an animated
    selection technique.

  • Can Flash do true vector graphics?

    I created a drawing in Flash with the pen tool and paint
    bucket. Some of the drawing I may have used the line segment tool
    and connected the points. Other parts of the drawing I may have
    started with a circle, added points, and strecthed parts to make my
    desired shape. I exported the file to an .eps format.
    I want a drawing to be transcribed to a T-shirt.
    Unfortunately the two shops I've worked with know CorelDraw
    and not Flash. One lady knows Illustrator and I have also
    exported to an .ai format for Illustrator. However when
    they open those formats of my drawings come as individual
    vectors with outlines around each piece. They said they would have
    redraw the artwork in CorelDraw at a major expense. Can Flash do
    true vector graphics such that a drawing of a figure, for example,
    with many different colors so that the exported .eps or .ai file is
    a true vector graphic and not all in pieces? Or should I go with
    Illustrator CS3? I have used both programs and most of the drawing
    tools and methods seem to be the same, does Illustrator create true
    vector graphics?

    While your code might be correctly written, a 1009 error is not about incorrect code.  The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is declared but not instantiated
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

  • Live Composition Preview Window...Vector graphics are blurred

    Live Composition Preview Window...Vector graphics are blurred even though I have the 'Continuously Rasterize' button selected. I’m using the latest After Effects and Illustrator. Other compositions within the same ae project are all 100%, then when I started another new composition, the graphics are blurred, making it incredibly difficult to work out what I’m animating as I need to zoom in and it blurs a lot. It is not a RAM issue with the MAC. Can anyone help? I was going great creating motion graphics, then all of a sudden his happens and I’ve tried everything.  Thanks.

    kerrie-rim wrote:
    I just presumed that once the 'Continuously Rasterize' button was selected, this would omit any fuzziness regardles of zoom percentage. its a pity it does not in my opinion.
    Again, you're misunderstanding what the comp window is doing. It is showing EXACT pixel representation of what is going to be output to the rendered video. Therefore it would be quite wrong of it to show anything at a higher resolution than the final output. As a video pro, I need to know what is going to be output. If I zoom in and it's showing a crisp vector graphic, that's not useful in the least.
    If, for some reason, you need to work with something zoomed in, make a composition with a higher resolution and work in that. Then embed it in your final comp.
    kerrie-rim wrote:
    Maybe i'm going mad!!
    Possibly

  • When to use Flex Or Flash Or HTML-Javascript

    I am Experimenting with Adobe AIR. I know AIR Applications
    can be developed either using Html-Javascript Or Flex Or Flash.
    But can anybody HELP me understand when do i exactly use Flex
    or HTML-JS.
    Well i know one of the reason to use Flex is to build
    RIA's.What are the other Possible reasons ?? can i draw a Decision
    Boundry between them??

    The best reason to choose one tool over the other is that you
    have something working in that language already, and are just
    extending it into the AIR world.
    If you're starting a new project, you then have to balance
    tools you have and know how to use against the strengths of the
    tools. A tool you don't know has to have some pretty compelling
    strengths to make you take the time to learn it, unless you're just
    doing it for fun. If not for fun, the effort has to pay off, yes?
    Very generally speaking, here are the strengths of the tools,
    as I see it.
    For HTML + Javascript, just look at what you see on the web
    today. People are pushing browsers pretty hard these days with web
    apps, so that gives you a good first-order idea of the power of
    this tool set. The AIR environment does give you some more power,
    not just in the AIR APIs, but also in having a single modern
    browser to develop for, so you don't have to limit yourself to IE6
    compatible code. Still, it's not yet the equal of the other tools
    in some areas.
    Flash's main advantage over the others is in applications
    with lots of graphics and animation. The reason for this is purely
    because that's what the Flash authoring environment is geared to
    produce. It's not got a very good ActionScript editor, and as a
    consequence there's a practical limit on how much code you want to
    write in a given project. It's not a question of whether you
    can write a 20,000 line ActionScript program within the
    Flash environment, it's a question of whether it's better done in
    another tool.
    One of the best "other tools" when you end up with lots of
    code is Flex. With the "Builder", you get Ecipse, and without, you
    are presumably using some other worthy programming environment.
    But, you give up the graphic and animation tools from Flash, and
    you give up a lot of the simplicity of HTML + Javascript.
    You can combine them, of course. You could build a whizzy GUI
    control in Flash to use in a Flex application which is hosted
    inside a web page, for instance.

  • Animate Stroke Weight of a vector graphic

    Hi. I'm new to adobe's programs and digital art as a whole, so bare with me. I've watched all of the tutorials on adobe's website to learn my way around and am excited to utilize these new tools. I'm trying to create an idea, but am having trouble figuring out how to do is this. I would like to create an animation of a vector graphic I created, but I would like the stroke weight to increase from .001 to about .3 or so. So It would be 300 frames. I imported my AI file to AE but there was no option to adjust the stroke weight in there. Is there an easy way to go about what I'm trying to do rather than save out 300 different files and organize them into a video? It's also composed of a complex pattern brush so I think the program is working pretty hard. It takes like 10 seconds or so for a big increase in stroke weight to load, but there is lots of detail so it makes sense I guess. Thanks for your time.

    Thank you. I made a simple vector to test your method. This is exactly what I was trying to do. However, I think my image is too complex for the program to handle. I waited 53 minutes for after effects to try and load the shapes before force quitting.. Do you think I need to just be more patient and give it a few hours? My other concern with that though is if it manages to load all the shapes if I'm going to be experiencing ultra lag trying to do any editing to the image once it's fully loaded. My image is metatron's cube composed of very tiny metatron cubes. I'd upload the file for someone else to experiment with but it doesn't look like these forums have attachment options. Any advice on this issue? I'm running a 2011 iMac with 16gb ram. The activity monitor only shows about 1-4gb of ram being used during this process.

Maybe you are looking for

  • Error with printer setup

    Error with printer setup but everyhing seems to be fine

  • Why does Flip-Pal Scanner's SD card down load photos to Organizer even the photo is already in Organizer?

    Why does Flip-Pa Scanner's SD card down load photos to Organizer even though the photos are already in Organizer.  My preferences are to not load again photos already in Organizer.  My camera SD card loads photos only one time.

  • Transport Request creation in ECC 6.0

    Hi, I am trying to do translations in SE63 and SE91( Message Class) in ECC6.0. I am not able to create Transport Request for the changes.Can any one help me in creating Transprot Request for translations in ECC6.0. If possible can any one give me URL

  • Reinstalling Muse isn't working.

    Computer crashed and had to uninstall Muse now need to reinstall. My download page showing my products only shows the Premiere monthly subscription - Muse is not there at all. I need to reinstall Muse and the only thing I see is the trial version on

  • Change in multiple classification through ECR

    Dear experts, We are using class type 050 (Reconciliation) for the classification of material BOM. I have assign two different classes (but same class type i.e 050) to a material BOM. but whenever I changes the classification data in reference to an