What is the function of "main()" into a flex application?  If this is not the case, how to exploit the "message pump' access the CPU?

I'm learning Flex and trying to write a VERY simple app to put random dots or lines on a mx:Canvas.

I can't know where in fact the code in the code canvas.graphics.lineTo(x,y).

Either I want to enter the processor in the "main() function" of the app or draw a point/line for every CPU in a message (as for Windows applications) pump.

I tried to add this:

< mx:Canvas id = "canvas >"

...

< mx:Script >
<! [CDATA]

canvas.graphics.lineTo (Math.random () * 300, Math.random () * 300);
[]] >
< / mx:Script >

but the compiler Flex says:

1120: access of undefined property canvas.

How is he can't find the canvas?

If I add the keyword 'this' like this:

this.canvas.graphics.lineTo (...)

I get:

1042: the this keyword can not be used in static methods. It can only be used in instance methods, function closures and the global code.

Where should I put the actual graph code or a loop to draw lines? Help!

Pete

If this post answers your question or assistance, please mark it as such.

Your drawing code must be in a function, and in the following code, it is called application creationComplete. You cannot draw directly on a canvas (at least I couldn't), so match zero on a Sprite or a SpriteAsset, wrap it in a UIComponent, so it can be added to the container and then adds the UIComponet to the canvas.


  
    
  
  

Tags: Flex

Similar Questions

  • My pcg-7a2l is very slow. I want to spend the cpu and ram. What is the cpu socket and the ram need me it?

    My pcg-7a2l is very slow. I want to spend the cpu and ram. What is the cpu socket and the ram need me it?

    Hello

    PCG-7A2L is the configuration of the equipment donated by Sony code. Try to find the model # begins with "VGNFS6". Check the following link to locate the model #:

    http://eSupport.Sony.com/us/p/support-info.pl?info_id=264

    The option to upgrade the processor is not available. However, you can check if the RAM can be improved. Enter the model # below for specifications of Marketing:

    http://eSupport.Sony.com/us/p/select-System.pl?Director=docs

    Try the procedure described on the following link to resolve problems when the computer is running slowly:

    https://us.en.KB.Sony.com/app/answers/detail/A_ID/39709/c/65, kw/66/39709

    If my post answered your question, please mark it as an "accepted Solution".

  • I downloaded the new version and it says: you cannot use this application with this version of Mac os how can I download the older version?

    I downloaded the new version and it says: you cannot use this application with this version of Mac os how can I download the older version? My os is 10.4.11

    You can read this article: Firefox no longer works with Mac OS X 10.4 or PowerPC processors to read about the EOL for Mac 10.4 support and what the best options going forward.

  • I try to capture a Web page using the Acrobat "Convert" icon, but this no longer works. I get an error message: "no access to Acrobat WebCapture. Acrobat is posibly busy or waiting for input. »

    I try to capture a Web page using the Acrobat "Convert" icon, but this no longer works. I get an error message: "no access to Acrobat WebCapture. Acrobat is posibly busy or waiting for input. »

    Thanks Abhishek,

    already, this option was unckecked. But miraculously it works now (after spending hours trying...).

    Beste, Geert

  • Load the bmp images into a flex application

    Hello

    I am currently using the "Embed" method for images on a Flex application. I use the png and JPEG format.
    Flex prefer JPEG, TIF, png? or PGO can be used as well?
    I find that when I try to add a bmp image to an Image tag, it is a 'go '.

    Is there another type of container that will handle BMP? Or is - everything as well use JPEG, png, etc.

    Thank you
    eholz1

    You can load a BMP using this cookbook recipe.

    http://www.Adobe.com/cfusion/CommunityEngine/index.cfm?event=ShowDetails&ProductID=2&postI d = 10264

  • The multi-version Flex applications | is this possible?

    I have a Flex Application that contains 2 modules. The Flex application is compiled using Flex 3.0 SDK. My question is: I want to compile only those 2 flex modules using Flex SDK 3.5. In this case, if modules can communicate with the main application without any problem and how to implement it? Please explain in detail.

    Mixture of versions with their charger and modules is not supported.  There are

    messages on the support of cross-management of versions of "Marshall Plan" that uses

    under apps instead of the modules in the doc of flex and my blog.

    However, mixture of version not be prevented.  If he happens to work for

    because none of the classes and common APIs introduce incompatibilities,

    then you can go into production with such a configuration.  Generally

    check for errors and are easy to find, but no cause of incompatibilities

    always...

    --

    Alex Harui

    Flex SDK Team

    Adobe System, Inc..

    http://blogs.Adobe.com/aharui

  • What is the cpu processor schedulare [algorthim] for Windows Vista?

    I need to know what the planning algorithm used in Windows Vista SP1?

    Hi Marc,

    Your question would be better asked on the MSDN Forums
    MSDN Forum -http://social.msdn.microsoft.com/Forums/en-US/categories

  • When opening a file that I have to choose what program created to run and some files is read only this should not be and wont open, usually of .exe files

    This started after I tried to remove the gel frog via the control panel. After that this withdrawal, or if he asked me to choose a program to run a file I tried and I hit adobe and adobe is now the icon like any and will not open most of the files because it does not support, I can not open almost nothing except the browser explore. I was able to get my malwarebytes to come and showed some virus that I removed, but now I don't know how to solve other problems

    Looks like your Windows file associations have to dispose. This means that XP doesn't know what to do with files by looking at the file extension (.exe for executables)., .doc for MS documents, etc.  When you run Internet Explorer, it's a little different, that's why IE usually still works fine...

    If you don't have it you, something done for you - most likely malware.

    Go to this site WWW by Doug Knox:

    http://www.dougknox.com/

    On the left, click on the Win XP fixes, file Association fixed and read the instructions at the top of the page.

    Download the EXE File Association Fix on your desktop, unzip the file and apply it by following the instructions at the top of the page, then to restart and test.

    Run the following scans for malware, and then fix any problems:

    Download, install, update and do a full scan with these free malware detection programs:

    Malwarebytes (MMFA): http://malwarebytes.org/
    SUPERAntiSpyware: (SAS): http://www.superantispyware.com/

    They can be uninstalled later if you wish.

  • Image map into a flex application?

    Will it be possible to have an image with something like an image map? as in HTML

    I have an image in my application and I would like a link but only in a small part of the image of mi.

    Do someone knows something about it? Or any suggestion...

    Thank you!

    Sue

    Hello
    Take a look at this, you have a component called it imagemap is what I use and it is very good.

    http://code.Google.com/p/flexlib/wiki/ComponentList

  • What is the best laptop to use with Photoshop CS5?

    I don't want to spend more than $3,000 for this laptop.

    I'll also use this laptop for Dreamweaver, Flash and Illustrator.


    All suites - tips v Design Premium Web Premium?

    I'm getting into web development after having been out of commercial art and design for 15 years.

    Thank you.

    You can get a laptop big Cyberpower PC that will run Photoshop. You must follow certain basic requirements as much as RAM and CPU. My article here: http://robertoblake.com/blog/2011/07/building-a-photoshop-cs5-computer/ has some good general information on what you need. However, here are the basics.

    Try to ensure that the hard disk of the diving is 5400-7200 tr / MIN, at least 500GB, 4-8GB of RAM, try to avoid embedded video if you can help it, video 1 GB is ideal, but you can live with 512 MB processor: Dual-Quad Core 2.0 GHz or better.

    Your going to want an external hard very portable, not only for backup, but set as you Photoshop Scratch Disk, recommend it be SSD (Solid State Drive)

    I highly recommend picking up this laptop: http://www.cyberpowerpc.com/system/Xplorer_X6-9200_Gaming_Notebook/

    Quad Core, 8 GB RAM to speeds of CPU maximum of 2.2 - 3.0 GHz, 2 GB NVIDIA graphics card, 640 GB HDD, all for under $900

    You see the game computers are perfect for Photoshop, the power required to run games more advanced far exceeds the resources necessary to function well Photoshop and other Adobe applications. This should be everything you need and much more.

  • What is the interaction between appellant VIs and subVIs using VI Server?

    I am student at the CLAD and one of the lines in the document preparation or here is the following:

    What is the interaction between appellant VIs and subVIs using VI Server?

    I know how to use the function "Call for reference" to call a VI, but not necessarily a Subvi. I thought a Subvi is always loaded with the calling VI and has nothing to do with the server of VI. What Miss me?

    Hi Bmihura,

    I think that this article will clear up how the VI Server works with subVIs called statically or dynamically.

    Call a VI by reference

    Best regards

  • What is the technology used for the integration of java with Flex application?

    How we integrate java into a Flex application or how to build flex applications that use Java as a backend?

    BlazeDs is currently used in businesses to serve the above purpose?

    Or is there a better technology that is used in businesses for the integration of Java with Flex application?

    What is the latest version of BlazeDs?

    Also, please give me a few important article links which shows a sample application in Flex using Java development as a backend.

    Thank you in advance.

    BlazeDS is the way to go. Just google BlazeDS and you will find many examples of link Java to Flex via Remoting and BlazeDS.

  • What is encrypt function files in Vista?

    What is encrypt function files in Vista?

    Ok. But I do not understand when we should use.
    If we protect our account with password, why do we need EFS?

    Hi, Open58,

    Do you intend to send or share files?

    When should I encrypt files and folders?

    http://Windows.Microsoft.com/en-us/Windows-Vista/when-should-I-encrypt-files-and-folders

    Best practices for EFS file system

    http://support.Microsoft.com/kb/223316

    I hope this helps.

  • What is the difference between hard links and junctions?

    Hey, if my computer is bogged down and I'm working on speeding up. I have two hard drives, and C: represents 87% of full while D: is very empty. I play PC games so I installed Steam on my computer in my C: drive and its about 45 GB. I want to fly over as many of what I can and I've fallen on junctions and hard links. So I want some help forming in line of command and advise if it is actually help

    I do not understand the difference between the hard links and junctions so I do not know which one to use, but I know that I don't want the original still on the C: drive, so should I use a hard link?

    C:\mklink/h "D:\SteamSpare" "C:\Program Files (x 86) \Steam.

    would this work?

    Wednesday, August 11, 2010, 22:06:23 + 0000, 8bitAudio wrote:

    I use Microsoft Security Essentials for anti-virus

    Good choice!

    and Spybot Search & Destroy as my anti-spyware/malware.

    I keep up to date and run Spybot normally every two days. I run a scan with MSE less often and usually a quick analysis. Usually when I try to run a full scan it stops randomly in the middle of it. Any suggestions?

    Spybot Search Destroy & was once among the best choices of
    the anti-spyware programs, but is no longer. I recommend that you
    Download, install and run time MalwareBytes AntiMalware and
    SuperAntiSpyware.

    Many times, this is not really slow but randomly becomes slow and can freeze, all CPU usage monitors fall to 0% - 2%

    Ken Blake

  • What is the model of support for the JSR - 172 (Device Software 4.3.0 and later versions)

    Hi all

    The technology of the JSR-172.
    She needs since the Device Software 4.3.0.
    What follows makes the model support has become?

    9530:
    9500:
    9000:

    8100:
    8110:
    8120:
    8130:
    8220:

    8300:
    8310:
    8320:
    8330:
    8350i:
    8900:

    8800:
    8820:
    8830:

    8700 c:
    8700g:
    8700r:
    8703e:
    8707g:

    7130e:
    7100i:
    7250:
    7290:
    7520:

    Thank you

    As Simon says, you can insist on the 4.3 OS (which is really the version of the software of the device) and request that people upgrade their phone if they do not have 4.3.  It is possible to use the Agent user on a download link to check that the phone is at a high level of enough.

    You can use the device, in which case support you later model pearls, "BOLD", Curve 8900, Bold, and Storm and so you should not miss for users who have upgraded their devices.

    Or, if the JSR 172 is the only thing of a BONE later you want, you could do what Simon suggests and use kSoap.  According to my experience, this is not a simple thing to get there, but once going, it works fine.  However we do not use it in production applications.

Maybe you are looking for

  • TOSHIBA 500 GB external HARD drive

    Hello Please I need help... My system is not able to recognize all available on my hard drive capacity. What should I do to use the hard drive full? 500 GB is the ability, now its GB full but only 256 and the rest I can't fill, I get a message 'not e

  • Your opinion about Satellite L775-111

    Someone at - it what model or able to give comments about it. It seems a reasonable price for its construction. 729 what other i5 17 inches could I get with the dedicated graphics card Thank youGeoff

  • When I open Safari, I get the window telling me to call Microsoft

    Safari opens with the window telling me to call microsoft my computer has been broken and security is threatened. I force quit only to reopen at the same. I did call the number. HELP PLEASE!

  • Pilot Bluetooth HP Pavilion g6-2313ax 64-bit Windows 8

    I've been looking and trying all the messages online valid and functional drivers for Bluetooth. All the drivers that I've tried so far to give an error that there is no ro deted material may be removed. Please suggest me a way to make the bluetooth

  • Problems with Microsoft Lifecam HD-5001

    I installed the webcam above about 1 week ago and have since had problems with Skype-to-Skype calls.  Initially, I thought it was a problem with Skype, my Skype call today was ok, but the webcam turned itself, no matter how many times I turned it on!