Basic graphical question (actionscript/flashbuilder)

I'm a totally newbie trying to create a library of graphical components that I can reuse in applications. I've created two projects in my workspace, one for the widgets and one for the application. When I draw the components onto the design screen, they now paint themselves as opposed to just being empty rectangles, great. They is something I'm missing however in the graphical heirarchy, b/c when I resize them they don't clear. Below is my class hierarchy:
public class WidgetBase extends Canvas
        public function WidgetBase()
            super();
        override protected function commitProperties():void
            // The idea here is that since this is a graphical object, all of its properties are probably
            // going to cause a redraw
            this.invalidateDisplayList();
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            draw(unscaledWidth, unscaledHeight);           
        protected function draw(unscaledWidth:Number, unscaledHeight:Number):void
            graphics.clear();
public class MyWidget extends WidgetBase
        public function BreakerWidget()
            super();
        protected override function draw(unscaledWidth:Number, unscaledHeight:Number):void
            super.draw(unscaledWidth, unscaledHeight);           
            graphics.beginFill(0xee0000, 0.9);
            graphics.drawRect(1, 1, unscaledWidth-1, unscaledHeight-1);                       
What do I have to add to get MyWidget to clear properly?

Hi Bob, thanks for getting back to me.
quote:
Originally posted by:
Bob Pierce
"_root.goRandom(this.slideshow_rand_mc.topslide_mc);"
There's a typo in that line - if it's in your code, it won't
work!
Ah, true. The typo actually happened when I was re-writing
the code in post. The actual code in the movie is
_root.goRandom(this.topslide_mc);
This is attached to a keyframe of the container movie-clip
containing the slides MC.
I've put the fla file on our server.
slideshow_random.fla.zip
If you, or someone else could download it and help me find
out what I'm doing wrong, I'd be ever-so grateful. I'm sure it's
something really obvious. Without being very familiar with Flash
and Actionscript, it's hard to explain things, and much easier to
show you the actual Flash file.
The 2 functions are on a keyframe on frame 1 of the root
timeline. The 'goRandom' function is supposed to be called from a
keyframe in 'slideshowRand_MC'. I envisaged calling the random
pause function from another keyframe in the same movieclip.
Thanks again,
Alex

Similar Messages

  • J2me newbie graphics questions

    Hi all.
    I've been messing with J2SE for a while but now I'm looking at J2ME for games on mobile phones.
    I've got a few questions which I'd appreciate any input on.
    1) Could you please point me towards somewhere I can get a comparison of screen dimensions/colour depth of current common mobile phones. E.g. what is the minimum/maxiumum dimensions I could expect to find on current devices capable of using java MIDlets (I'm currently looking at Nokia's N-Gage at 176x208,12bpp and 7210 at 128x128 but I've seen res low as 96x65 mono so any help is much appreciated).
    2) As far as I'm aware, I can't scale Graphics image draw function so I'd have to pre-calculate it in code if required. Is this right?
    3) I haven't found any way to draw an area of an image (only the entire image) in the basic Graphics class. Is there any way to do this, or even to make a new Image which references the same source data but uses a different stride?
    4) I understand that there is no support for translucency, but does punch through transparency work OK? If so then is there any significant hit for using it (in general, as it could vary dramatically with different hardware).
    Thanks in advance.
    -nmk

    P.S: Any comparisions of memory size and screen latency would also be helpful. thanks!

  • How do I change the color of Basic Graphic Lines?

    I used the basic graphic lines in the swatch library - (swatch libraries>patterns>basic graphics>basic graphics lines) to fill a retangle.  My question is, can I change the colors of the lines?  I have tried everything I know and can't seem to figure it out.  Does anyone have any suggestions?

    Almost answered - Thank you.  The problem I am having is, I was able to drag the swatch onto the artboard and change the colors, but I am not able to drag the new colored one back to the swatch panel.  All the swatches in that panel are black and white by default I guess.  These are stock swatches. I am working on a PC if that makes a difference.  I click the swatch with the selection tool and drag (control>drag?) and I get the little box with the + sign in it when I try to drag, but it bounces back.  Any Suggestions.  I am a total amature at this program, and am basically self taught.

  • Basic iPhoto questions:

    I have some Basic iPhoto questions before I start using the program:
    - does iPhoto apply any compression or change images in any way when they
    are imported?
    - after images are imported, can the original source folder of images be deleted off of the mac?
    - can Quicktime files exported from iPhoto be viewed on a Windows computer?
    - can iPhoto handle large resolution images that might be as large as 8-15mb each? does it display them quick? are there any known file size issues?
    Thanks!!!!

    kat.
    Is there a way to use iPhoto on a network so other users can read and possibly write to an iPhoto library on a networked mac?
    iPhoto is a consumer level photo organiser, not a server. It's possible to share photos but libraries are very difficult and fraught with the danger of database corruption. Some have reported success.
    Is it possible to password protect or secure certain images in the library so they can not be seen by anyone?
    No. The best I can suggest there is to create a second library and store it in a secure area like a protected dmg. But remember, you can only have one library open at a time.
    After photos are deleted from iPhoto, are there any remaining traces or cached files anywhere other than the trash
    If you delete photos from iPhoto and empty the iPhoto trash then the pics are removed from the Finder as well. They remain as findable as any other deleted file from that point, which is, very, if the searcher in knowledgeable.
    Regards
    TD

  • Object class deployment - Basic form question

    OK, I subclass calendar object from Oracle provided standard
    object class. What do I need to deploy to use this form now
    apart from calendar.pll and my fmx. What about the object class
    from which I sub-class. Do I need to compile and deploy that
    also? How will form resolve this on run time the parent object
    class as I really did not copy, just sub class and we do not
    deploy original class? Basic form question. Thanks.

    You can set the "help" property on the field (which gives you the little "information" icon link beside the field).
    You could also try adding another field of another class above or below:
    <Display class='InlineAlert'/>
    <Display class='ErrorMessage'/>
    <Display class='HtmlPage'/>
    ..etc
    -Rob

  • How to make the basic graphics frame VerticalJustification as bottom align?

    Hi:
    In indesigne CS3 script, how to make the basic graphics frame
    VerticalJustification as bottom align?
    Thanks in advance.

    Vertical justification applies to text frames, not to graphic frames.
    Peter

  • Swatch Libraries Basic Graphics won't stay on.

    I have Illustrator CS5 and I want the Basic Graphics (Dots, Lines, Textures) menu under Patterns in Swatch Libraries to stay on the dock whenever I start Illustrator. I save a new workspace with the libraries attached to the dock on the right hand side but when I restart Illustrator the button is not there and I have to open it manually each time. Please help.

    Many thanks.  And many apologies...
    I had already followed all those steps, and double checked them, so I thought that there must be some form of hardware conflict that needed to be resolved.  As a last resort, I hooked up the problem monitor to another computer.  Lo and behold, the monitor had coincidentally chosen that moment to go on the fritz. 
    Thanks again.

  • I'm working with Illustrator CS5 and am having trouble with basic graphics textures.

    I'm working with Illustrator CS5 and am having trouble with basic graphics textures. The illustrator drawings look fine with the pattern fills and when I bring the drawing into quark 9.1 they are still fine. When I print the quark file to lo res pdf drawing is still fine, but when I print to hi res pdf (press quality for print) the patterns disappear. I cannot figure out what the problem is.
    just a note. Other textures and artistic fills work fine. It seems to be just the basic ones. I'm wondering if for some reason they may not be saved completely in my libraries?

    Its just a drawing in black and white with some basic graphic texture to show “dirt”  The pattern consists of a bunch of small lines. I save the file as an eps. And bring it into quark.  When I print from quark I say print to pdf as press quality. I don’t think the problem has to do with acrobat because I’ve never encountered these problems before CS5. These drawings have been around for years and all of a sudden they don’t work.
    Does this help?
    Cath
    Graphic Specialist
    [email protected] 905-403-8658 x297
    P Is it necessary to print this e-mail?

  • Rotating "basic graphic lines" swatch in Illustrator

    I want to take one of the swatches from the basic graphic lines swatch, color the lines (which I found the answer to in the forum), but I want diagonal lines, not horizontal/ vertical lines. How to change? Thank you.

    one way would be to double click the rotate tool to show the rotate options, uncheck Patterns, enter the rotational value  and apply. Then do the same but with Patterns checked and the opposite of the previously used rotational value.
    The rotational value in the rotate options is the last one used, so if you want to do it interactively, first rotate the whole object the way you like the pattern rotated, undo and then use the above instructions. It would have been great if the values in these options boxes had interactive sliders but unfortunately they don't have that yet.

  • How to change the color of a basic graphic texture?

    The basic graphic texture pattern is black by default. I'm looking for a way to change the color of the black lines that create the texture.
    I read How do I change the color of Basic Graphic Lines? However, I am unable to select the black pattern lines with the direct selection tool and thus unable to change the color of the lines.
    Thanks in advance.

    all 14 views are from me refreshing
    can anyone recommend a better forum?

  • Adding Date/Time Field + X Number of Days - Basic Calculation Question

    I am assuming this is a basic calculation question. New to Adobe LiveCycle Forms.
    I have a simple form containing a table. The table appears as such:
    Text
    Formatted as Date/Time Fields
    Header 3
    Monday
    user wil choose the beginning date (Date/Time) this is DateTimeField1
    Tuesday
    this should calculate DateTimeField1 + 1
    Wednesday
    this should calculate DateTimeField1 + 2
    Thursday
    this should calculate DateTimeField1 + 3
    Friday
    this should calculate DateTimeField1 + 4
    Saturday
    this should calculate DateTimeField1 + 5
    Sunday
    this should calculate DateTimeField1 + 6
    Calculations are performed after the date is chosen for Monday. My mind tells me the simple calculation of DateTimeField1 + 1 is not going to work (and in fact doesn't!) as it needs to change Monday to a number first. I saw on another thread the following:
    Num2Date(Date2Num(Date(DateTimeField1), "DD.MM.YYYY")+7, "DD.MM.YYYY")
    Thought this was going to get me close. No cigars though!
    Any quick help is greatly appreciated. And since I am new to this, details about what needs to be changed would be great too!
    Thanks

    Here an addition for you date field.
    This FormCalc script in the exit:Event will check it the selected date is on a monday.
    If not it will go the days back until the last monday.
    var Selection = Date2Num($.formattedValue, DateFmt(2))
    var WeekDay = Num2Date(Selection, "E")
    var NewDate
    if (WeekDay eq 1) then
              NewDate = Selection - 6
    elseif (WeekDay eq 3) then
              NewDate = Selection - 1
    elseif (WeekDay eq 4) then
              NewDate = Selection - 2
    elseif (WeekDay eq 5) then
              NewDate = Selection - 3
    elseif (WeekDay eq 6) then
              NewDate = Selection - 4
    elseif (WeekDay eq 7) then
              NewDate = Selection - 5
    else
              NewDate = Selection
    endif
    $ = Num2Date(NewDate, "EEE DD.MM.YYYY")
    Hope this helps, too.

  • Basic Exporting Question

    My main question is a very basic exporting question, but here is a super-condensed explanation of my big-picture goal for context:
    Large (~450 MB) aiff on CD --> trim w/ Quicktime --> small (~16 MB) MP3 in iTunes
    I would like to take an audio file (aiff) that is approximately 450 MB and export it from Quicktime and in doing so, reduce the file size and convert it to MP3. When I simply try to export it, it doesn't ask me about what size I want, nor does it give the option of MP3 formatting.
    I have figured out how to reach my goal, but it's a mess. After I make my trims in QT, I have to:
    1. select "share" instead of "export".
    2. It asks me what size I want and I select small.
    3. The file is then exported as a Quicktime movie into Mail and the size is reduced from 450 MB to about 20 MB.
    4. I then have to "right-click" on the attachment in the email that is created,
    5. save the attachment,
    6. discard the email,
    7. import the file into iTunes, and
    8. create an MP3 in iTunes to finally arrive at my goal.
    This seems like a ridiculously convoluted process to change a large aiff to a small MP3 and put it in iTunes. Any suggestions?

    Thanks. I guess the basic answer to my question is that it can't be done in one or two fell swoops. The problem is that it starts on a burned disc, and I need to make edits to it before it ends up in iTunes (to be eventually used in iWeb). I was hoping to avoid juggling back and forth between iTunes and QT. I either would have to send it back to QT to do the edits after -->iTunes-->mp3, or import the large file from the CD to QT, make the edits, save changes, import large file to iTunes, convert to mp3.

  • MP 1.1 graphics question

    Mac Pro 1.1 graphics question
    I know this question has probably been posted to death but is it true that in a MP 1.1 we can't use the EVGA GeForce GTX 285? and if not.. what is the best upgrade option? this what I currently have..
    NVIDIA GeForce 7300 GT:
    Chipset Model: NVIDIA GeForce 7300 GT
    Type: GPU
    Bus: PCIe
    Slot: Slot-1
    PCIe Lane Width: x16
    VRAM (Total): 256 MB
    Vendor: NVIDIA (0x10de)
    Device ID: 0x0393
    Revision ID: 0x00a1
    ROM Revision: 3011
    Displays:
    Model Name: Mac Pro
    Model Identifier: MacPro1,1
    Processor Name: Dual-Core Intel Xeon
    Processor Speed: 2.66 GHz
    Number Of Processors: 2
    Total Number Of Cores: 4
    I really appreciate the help.. looking for at least 512 memory but was hoping for 1 gig...

    For what its worth, the NVIDIA GT 120 card will NOT work on the MAC PRO 1,1
    As I understand it, the newer mac pros use a 64 bit EFI boot prom, while our older 1,1 machines use a 32 bit EFI. The proms on most newer graphics cards won't initialize right at boot. Some ATI cards supposedly have both 32 and 64 bit firmware on the proms.
    I had hoped that if I put both NVIDIA cards in, I might still get the EFI to boot on my old 7300 GT card and then have OS-X recognize the newer card for an additional monitor and/or an openCL GPU. It was relatively cheap, but I never got it to work.
    Given the number of web posts that had incorrectly implied the NVIDIA should have worked in my machine, I decided not to try again on one of the more expensive ATI cards.

  • What's the best MacBook for basic graphic editing?

    Hi there,
    I've been saving up to finally get a MacBook after having a pro during university (stupidly it got soaked in my bag during a thunderstorm and didn't have any insurance on it). However, I'm trying to save as much money as I can so can't afford the high end laptops.
    All I need for the MacBook to do is run the following programs without it becoming slow in the long run:
    Adobe Photoshop CC
    Adobe Dreamweaver CC
    Adobe InDesign CC
    Microsoft Office Home & Business
    The basic system requirements for the Adobe CC programs are:
    Multicore Intel processor with 64-bit support
    Mac OS X v10.7, v10.8, or v10.9
    2GB of RAM
    3.2GB of available hard-disk space
    1280x1024 display with 16-bit video card
    QuickTime 7.6.6 software required for HTML5 media playback
    All I need it for is templating and editing newsletters as well as creative posters/flyers/brochures.
    I'm deciding whether I should just get the basic 13-inch MacBook Air, 13-inch Macbook Pro (with Retina display) or 2.5GHz Mac mini? Bear in mind that I'll have to purchase the Micrsoft Office program (approx. £157 on Amazon) & get a screen/keyboard/mouse with the Mac Mini).
    I have around £1,000 to spend and really unsure as to what to buy.
    Please note, I am not interested in buying a Windows equivelant (as I cannot stand Windows 8/8.1).
    Thanks!

    Any of those Macs will meet the basic specs for Office and Adobe. The real question is how you configure what you buy, based on how you are going to use the programs. The system requirements listed are definitely basic. They are about as basic as saying that you could buy a 2-seater Smart Car as your transportation: You could, but you'd be very limited in what you could do.
    If you are going to run any one program at a time, the base model of any of those Macs (4GB RAM) will be fine. But working on newsletters and flyers, for efficiency's sake you will probably have more than one program open at a time: Word for preparing text, Photoshop for preparing photos, and Dreamweaver or InDesign where you lay it all out, going back and forth between them. That increases your RAM needs. 8GB would be a good place to be, but if you can afford to buy with the maximum amount of RAM that would help future-proof the Mac (since future versions of software always need more RAM, not less).
    Having more RAM is more critical if you plan to use Photoshop for fancy stuff like cameras with lots of megapixels, raw editing, panoramas, HDR, or 3D. If you are just doing basic photo editing, 8GB RAM is fine. The other software you listed doesn't need as much RAM so more than one of them will run fine together under 8GB RAM.
    If you get a MacBook Air or MacBook Pro, they start with only 128GB storage and it cannot be upgraded. That might not be enough space in the long run if you use a lot of graphics files and photos, so think about specifying at least 256GB storage in whatever you buy if your newsletter projects are large and you don't want to store them on external drives. The Mac mini starts out with a nice big hard drive.
    What it will probably come down to is, spec out all three models you are considering with at least 8GB RAM and as much storage as you will need during the life of the computer, then pick the one that fits your budget. If you need portability, cross off the Mac mini.

  • Very Basic Functions Question

    Hi,
    apologies for this being a very basic question, but I rarely
    use Flash. About once a year, however, I am called upon to do some
    sort of (usually very simple) Flash-based project for the students
    I assist. This time it's a simple random slideshow.
    The setup is this:
    * I have a movieClip called 'slides_MC' containing all the
    slide photos, on consecutive frames.
    * This movieClip is placed inside another movieclip named
    slideshowRand_MC.
    This is given an instance name of topslide_mc, and faded up
    and down with alpha keyframes.
    The idea is that, when the slides mc is faded right down,
    some Actionscript causes the slides movie to jump to, and stop
    playing on a random frame, so random slides are faded up, then down
    again, then swapped.
    I need to apply some actionscript to particular keyframes so
    that the swap is performed at the correct time.
    This is my attempt at a reusable function to do the swapping.
    It's placed in a keyframe on the root timeline:
    // Go to and stop at random frame in slides movieclip
    function goRandom(mc) {
    // Number of slides in slides movieclip
    var slides = 22;
    // Random number between 1 and number of frames in slides
    movieclip
    var randFrame = Math.ceil(Math.random() * slides);
    mc.goToAndStop("slide_" & randFrame);
    This function is called from keyframes in slideshowRand_MC:
    _root.goRandom(this.slideshow_rand_mc.topslide_mc);
    I know this is really basic stuff, but can anyone tell me why
    this isn't working.
    I've tried adding a breakpoint in the goRandom function, but
    it doesn't look like it ever gets called.
    Any assistance very gratefully accepted.
    Alex

    Hi Bob, thanks for getting back to me.
    quote:
    Originally posted by:
    Bob Pierce
    "_root.goRandom(this.slideshow_rand_mc.topslide_mc);"
    There's a typo in that line - if it's in your code, it won't
    work!
    Ah, true. The typo actually happened when I was re-writing
    the code in post. The actual code in the movie is
    _root.goRandom(this.topslide_mc);
    This is attached to a keyframe of the container movie-clip
    containing the slides MC.
    I've put the fla file on our server.
    slideshow_random.fla.zip
    If you, or someone else could download it and help me find
    out what I'm doing wrong, I'd be ever-so grateful. I'm sure it's
    something really obvious. Without being very familiar with Flash
    and Actionscript, it's hard to explain things, and much easier to
    show you the actual Flash file.
    The 2 functions are on a keyframe on frame 1 of the root
    timeline. The 'goRandom' function is supposed to be called from a
    keyframe in 'slideshowRand_MC'. I envisaged calling the random
    pause function from another keyframe in the same movieclip.
    Thanks again,
    Alex

Maybe you are looking for

  • Connecting an ipad 2 to a non hd tv

    Hi. I have the cable to connect to a HDTV which is fine but my new apartment has the old style box tv - is there any way of connecting the ipad to the old TV?

  • I cannot get through to my yahoo mail - can log in but receive an error msg

    As above, I receive the following message when I try to login to yahoo mail. This has been a problem ever since downloading some awful program called Babylon, which was claiming to give me a TV programme download I was after. I have cleared recent co

  • NEED HELP...mainly with re-setting up my router

    This is really complicated (I think) so bare with me, please. I have a Wireless router, WRT546, Geek Squad had to set it up for me (unfortunately, this tells you my level of wireless knowledge).  All was fine until: There was an interruption in my ph

  • How to disable account? need help.

    I made 4 different users account on my mac computer, now i want to disable the two, so is there any possibility to disable it? i did manage to disable the guest account but the rest no. thank you so much for those person who could help me with this,

  • Problem with oracle forms,jre & sun thin clients

    we have oracle forms using jre 1.5.0 update 11 running on more than 100 thin clients . but the application hangs when navigating through the forms sometime. if all the browser window is closed and started from the begining it again works fine any sup