Applying physics to movieclip created with createEmptyMovieClip...

Hey all,
Im new to the forums and actionscript so be generous...
As the title suggests i want to apply physics (gravity mainly) to a line drawn with the curser using the createEmptyMovieClip method.
Below is the code in the main frame (sorry its a bit long), what I'm trying to do is make something like crayon physics (i know it will be difficult).
So far i can draw lines and make certain objects ( a ball for example) be affected by gravity, but when I try to make the drawn lines be affected by gravity it stuffs up.
The first line drawn is produced in the wrong position, (it should be at mouse point but isn't) and you can't draw any subsequent lines. This problem doesnt exist when i remove the gravity, any help is much appreciated.
Basically what i want is that each line that is drawn can have actions assigned to it... (so i can add gravity and unique properties for different line types)
Hope that makes sense and you can help .
//force settings
//Drawing tools
_global.general = 0x0000FF;
//blue
_global.rubber = 0x9400D3;
//purule
_global.spring = 0x32CD32;
//green
_global.rope = 0x8B4513;
//brown
_global.explosion = 0xFFFF00;
//yellow
_global.explosion2 = 0xFFA500;
//orange
//tool setings
var thickness = 2;
_global.tool = general;
var alpha = 100;
//Scene colours
var land = 0x000000;
//black
var prop = 0x1D1D1D;
//charcoal      (non-gravity affected prop)
var gprop = 0x696969;
//dim gray      (gravity affected prop)
var backg = 0xD3D3D3;
//light gray
//Active objects
var main = 0xFF0000;
//red
var orange = 0xFF4500;
//orange
var a = 1;
var b = gen;
var menu = 0;
var d = 0;
LineA = new Array();
this.onLoad = function() {
for (a in LineA) {
LineA[a].power = 0.3;
LineA[a].yspeed = 0;
LineA[a].xspeed = 0;
LineA[a].friction = 0.95;
LineA[a].gravity = 0.1;
LineA[a].thrust = 0.75;
this.onEnterFrame = function() {
d++
for (a in LineA) {
LineA[a].xspeed *= friction;
LineA[a].yspeed += gravity;
LineA[a]._y += yspeed;
LineA[a]._x += xspeed;
onMouseDown = function () {
createEmptyMovieClip("Line", 1);
Line.lineStyle(thickness, tool, alpha);
// The function onMouseDown is activated when you click the mouse
button.
Line.moveTo(_xmouse, _ymouse);
// This moves the line to the starting point, which will be directly
where you
// clicked._xmouse and _ymouse are the x and y position of the mouse.
onMouseMove = function () { Line.lineTo(_xmouse, _ymouse);};
// This creates the line to the point where ever your mouse is dragged.
onMouseUp = function () {
// The function onMouseUp is activated when you release the mouse
button.
onMouseMove = null;
// This function turns off the onMouseMove() function so that the
line will
// not be drawn again until the user clicks the mouse button again.
a++;
// d = a
// a = b+a
duplicateMovieClip(LineA, "LineA"+a, a);
// a = d
c = a;

try:
//force settings
//Drawing tools
_global.general = 0x0000FF;
//blue
_global.rubber = 0x9400D3;
//purule
_global.spring = 0x32CD32;
//green
_global.rope = 0x8B4513;
//brown
_global.explosion = 0xFFFF00;
//yellow
_global.explosion2 = 0xFFA500;
//orange
//tool setings
var thickness = 2;
_global.tool = general;
var alpha = 100;
//Scene colours
var land = 0x000000;
//black
var prop = 0x1D1D1D;
//charcoal      (non-gravity affected prop)
var gprop = 0x696969;
//dim gray      (gravity affected prop)
var backg = 0xD3D3D3;
//light gray
//Active objects
var main = 0xFF0000;
//red
var orange = 0xFF4500;
//orange
var a = 1;
var b = gen;
var menu = 0;
var d = 0;
LineA = new Array();
this.onLoad = function() {
for (a in LineA) {
LineA[a].power = 0.3;
LineA[a].yspeed = 0;
LineA[a].xspeed = 0;
LineA[a].friction = 0.95;
LineA[a].gravity = 0.1;
LineA[a].thrust = 0.75;
this.onEnterFrame = function() {
d++
for (a in LineA) {
LineA[a].xspeed *= friction;
LineA[a].yspeed += gravity;
LineA[a]._y += yspeed;
LineA[a]._x += xspeed;
onMouseDown = function () {
createEmptyMovieClip("Line", 1);
Line.lineStyle(thickness, tool, alpha);
// The function onMouseDown is activated when you click the mouse
button.
Line.moveTo(_xmouse, _ymouse);
// This moves the line to the starting point, which will be directly
where you
// clicked._xmouse and _ymouse are the x and y position of the mouse.
onMouseMove = function () { Line.lineTo(_xmouse, _ymouse);};
// This creates the line to the point where ever your mouse is dragged.
onMouseUp = function () {
onMouseMove = null;
lineA.push(Line);

Similar Messages

  • Is CJC compensation automatically applied to Virtual Channels created with MAX?

    I have a SCXI 1000 chassis, a SCXI 1102 module and a TC 2095 terminal block. I am configuring virtual channels with the names TC(n) where n is the channel number. When I configure the virtual channel, I am selecting 'built-in' CJC. The question I have is:
    When I reference the virtual channel from my DAQ application, is the data I receive already cold-junction-compensated, or do I have to read the CJC voltage as a separate channel, and apply the correction factor manually on my block diagram (like we had to do in the old days)?
    I gather that the data that I read, which is obviously scaled to engineering units, is, indeed, cold-junction compensated, but I would like to be certain that t
    hat is the case. Thanks.

    Wes;
    You are right. That is the way it works. If you specify the CJC compensation in MAX when creating a Virtual channel, to be the built in CJC, the data you get is going to be CJCed already.
    Hope this helps.
    Filipe

  • Usage limitations on files created with CS6 beta?

    My gut tells me that the cs6 beta falls under the cs6 license sections "Non-Serialized Software" and "Evaluation software" which state:
    "...for demonstration, evaluation, and training purposes only, and only if any Output Files or other materials produced through such use are used only for internal, non-commercial, and non-production purposes."
    Am I correct in assuming that this applies to all files created with the cs6 beta? I don't see this discussed anywhere which makes me wonder. I have made some nice progress on one of my files and now I'm wondering if I have to stop and redo everything in my old version. I don't want to sink much time into the beta if nothing I create is publicly usable.
    Official clarification would be appreciated.

    It's completely awkward that I haven't realised this so far, usually I export everything to PNG -> resize PNG with ACDSee -> convert to JPEG and then forget about it Thank you for clearing this up!

  • How to edit a PDF created with Acrobat XI Pro after signatures have been applied (like I can in 7, 8.0

    I have a major issue that I need to resolve before we can purchase Acrobat XI Pro:
    Currently, with Acrobat 8.1 Pro, after all signatories sign a document, we add an Effective Date (we add it after they sign since we don't know when the last signature will be acquired and we can't have an Effective Date that is before the date of the last signatory, otherwise, it would be effective before they signed it, which is not possible). I'm also allowed the latitude (as stated in our Documentation Control procedure) to make spelling corrections, hyperlink updates and minor formatting changes (by using the typewriter tool and also by replacing a page that is NOT the signed page if the change repaginates the document or involves modifying a hyperlink that has changed).
    In all of the previous versions of Acrobat that we've used (7 Pro, 8 Pro and 8.1 Pro) , this has been easily possible and all changes would be listed under the Signatures tab, which is exactly what we want, which is traceability.
    I'm using the trial version of Acrobat XI Pro now but am getting the message "This document is signed and can not be edited." If I bring the same PDF that was created from Word 2003 & 2013 using Acrobat XI Pro into 8.1 Pro, though, I CAN add the date, use the typewriter tool and replace non-signed pages, save it and exit without clearing or losing any signatures.
    My question is this: How can I do this in Acrobat XI Pro, as XI Pro (in the Signature pane) also lists the changes made to the document when it was edited using 8.1 Pro? (It's OK that the changes made to the PDF then mark the signatures as "invalid", as the reason why they were invalidated is also listed in the Signature pane, e.g. "Form Field Added", which is usually the applied Effective Date.)
    Thanks for any help!

    Acrobat versions prior to 9 had a bug which allowed you to do what you did. In Acrobat 9 this bug was fixed. In order to do what you want you need to certify (apply special certification digital signature with your certificate -- it is "Certify (Visible/Invisible)" choice in the "Work with Certificates") your document first. In the process of certification you can specify which modification permissions you allow the users of your document to make after signing. Certification signature must be the first signature in the document.

  • Applying filter to images loaded with movieClipLoader

    Hello,
    I am building a product gallery and have a number of rather
    large bitmap images that I am loading with movieClipLoader. I need
    to apply drop shadow filters to them when they are loaded. I have
    tried several methods of going about this without success. One
    method was putting the loaded images into a movie clip with
    createEmptyMovieClip, and then applying the filter dynamically, but
    I couldn't seem to get it to work- the filter never appeared. I
    then tried applying the filter to the bitmap itself with
    bitMapData, but because I was not loading the bitmaps using
    bitMapData itself (I think) I wasn't able to get that method to
    work either.
    Does anyone have a suggestion or a recommendation for me?
    Thanks very much for any advice.

    Were you doing it after the onLoadInit event in the
    MovieClipLoader's listener?
    Try doing it that way if you haven't. One option I use for
    dynamic image loading is to create and empty holder clip - use that
    for placement and create another empty clip inside that one that I
    use as the loading target... I think this should work if you set
    the filter at the level of the first 'empty' clip. I had to use
    this approach a number of times because I was using a tweening
    engine based on movieclip prototype extensions (old hat I know) and
    loading new images kicked out the extended functionality from the
    clip the images are loaded into. That doesn't happen to the clip's
    parent... hence I think it might work also for what you want to do.
    Another thing to watch for is that you can't do bitmapData
    copies of images from a different domain unless you have
    crossdomain policy support - you can set it up so this works. I'm
    not sure if this affects filters though.
    -GWD

  • Sales Order Created with reference to Contract - Exchange rate Issue

    When Sales Order created with reference to contract VBKD fields KURSK and KURSK_DAT gets copied from contract and not redetrmined based on pricing date and Exchange rate type. I expected it to be determined based on pricing date is standard. What I am missing, should it be controlled by data transfers
    If Document currency and condition currency are different it cause problems with incorrect condition values are calculated, as KOMP-KURSK are copied from VBKD-KURSK
    Any help or directions would be greatly appreciated . We are on 4.7 ISOIL
    Sincerely Julietta

    Well,
    and if we have the same issue, but we don't have OIL Version, but simple 4.6C, which solution has to be applied then?
    Thank you
    Standa

  • How can I change the frame around a title created with the Rectangle Tool?

    In PrE 7, I have been creating titles (e.g.: Title > New Title > Default Still, etc.) for a long time and using the many ways to manipulate the text (type, color, size, animation, etc.). Today, I tried to use the Rectangle Tool (or the Ellipse Tool, or the Line Tool) and they created a beautiful 'frame' (like a picture frame: artistically designed and colored) and I can change the background color within the frame and place any text (also background picture, etc.) in it. However, I couldn't find any way to change the 'frame' or the general style of these title objects. Is there any way to do this, or this is the only design that can be created with these tools? I would greatly appreciate any help (couldn't find any in this u2u site). Thanks, Laci.

    Laci,
    Yes, you can apply Styles to several Rectangles (or other Shapes), to simulate a "frame." The Styles should appear as Text in the Styles Panel. Since you are working with Shapes, but viewing the Styles applied to Text, it is not perfectly intuitive as to what those Styles look like with the Shapes.
    Personally, I find that doing things like "frames" in Photoshop and then Importing the PSD's into PrE is far, far easier. In that case, I would place the PSD on Video Track 1 (unless I wanted it to appear superimposed over my Video (like a PiP), and then do the text in a PrE Title, and place it above the PSD.
    Here is an example:
    This is a simple "picture frame" created in PS. I used a still image, instead of text in this case. These could be "wood-grained," "granite," etc.
    Much more control and tons of Effects and Filters that can be applied.
    Good luck,
    Hunt
    PS - that is from PrPro, so the GUI will look quite different, but things work the same way.

  • Cannot opening PDF created with Adobe Acrobat 5 on Samsung Android device

    Hi I have an number of links to PDFs on my WordPress.com blog home page (www.creationtonewcreation.com). These were created in Adobe Acrobat 5, with security applied that allows viewing and printing. They open fine on my laptop (e.g. with Google Chrome), but when trying to open on my Android mobile (Samsung Note 3 - a standard design) with Acrobat Reader installed, an error message appears 'The document cannot be opened because it is not a valid PDF document'. It is a valid PDF as it was created with Adobe 5 itself. Do you know what the problem might be?  I have uploaded another PDF (not sure what this was created with) on my other WordPress.com site, and it downloads fine, so WordPress.com is not the problem per se.  Many thanks for any advice anyone can give.  Rob

    Hi Robert,
    I am so sorry for the inconvenience caused & will try my best to get this issue resolved.
    I will recommend you to upgrade your Adobe reader to Adobe Acrobat Reader DC on your Samsung Note 3 mobile phone and then try to view the pdf files. You can download it for free from the Google app. store or you can refer to this link Acrobat Reader DC Learn & Support.
    Let me know if you still experience the same issue.
    Regards,
    Aadesh

  • Play dvd created with iDVD won't play in QuickTime

    Hi!
    Just a simple question:is it possible to play the dvds I created with idvd in quicktime? and if so, how?
    If not, are there any other players one could recommend for detailed video analysis and coding? Ideally I need to be able to forward to a specific time and to take notes at the same time (would need that for my research project).
    I can not open the dvd with QuickTime, even when I set it as the default player in system preferences.
    The only thing that works are VCL and the pre-installed DVD player.
    I have QuickTime Player Version 7.1.3.
    and the movies are downloaded from my digital camera with iMovie 6 and then exported and burned with iDVD 6
    Many thanks!!!

    Just a simple question:is it possible to play the dvds I created with idvd in quicktime? and if so, how?
    Yes and no. QT does not play DVD material (VOBs in VIDEO_TS folder) natively. In order to play the video portion of the "muxed" data stream requires the purchase of Apple's MPEG-2 QT component ($20). Even then, most commonly used "muxed" audio formats are not supported. Since QT does not properly handle/convert this material, Apple included the DVD Player as you have already mentioned. This application will play both DVDs and VIDEO_TS folder VOBs on your HDD.
    If not, are there any other players one could recommend for detailed video analysis and coding? Ideally I need to be able to forward to a specific time and to take notes at the same time (would need that for my research project)
    MPEG Streamclip (a free MPEG based third-party application), will also play VOB files (single or multiple file series), allow scrubbing to a particular time, select segments, and, if you have the QT MPEG-2 component installed, perform minor edits, apply "on-the-fly" filters for bightness, contrast, saturation, volume, de-interlace, crop/scale, etc. as it converts to QT compatible formats (if your iMovie projects are no longer available) or third-party formats for which you may have other installed components. While it will provide limited "stream" information, I would not call it an analytical tool. (E.g., provides audio/video information like formats average data rates, audio sampling rate, etc. but not graph/read things like an instantaneous data rate -- something I have been seeking.)

  • Residual items are created with the current exchange rate

    Hello,
    When a residual item is created due to a short payment for an invoice, the residual item is created with the exchange rate that is in effect on that day.  Is it possible to assign the exchange rate equal to the rate that existed on the original invoice.
    Thanks in advance for you ideas.
    Karla

    Hi,
    You can use transaction FB05 for doing the clearing there you would be able to input the exchange rate you need for clearing the AP/AR/GL items.
    But the exchange rate at the time of making/receiving the payment or at the time of clearing is what should be applied.
    Regards
    K.R

  • Delivery get created with one line item from sale ord having two line item

    I have an issue when delivery is created with reference to a sales order.
    The sale order consist of a header with customer group VBKD-KDGRP = '01'. There are two line item for this header with item 10 having customer group '01' and line item '20' having customer group '02'.
    When delivery is created with reference to this sale order the delivery contains only one line item corresponding to line item 10 having customer group '01' of the sale order. But I need to have both the line item in the delivery irrespective of difference in customer group.
    What makes this split up of delivery? Is there any configuration or user exit that need to be applied in order to adress this.
    <REMOVED BY MODERATOR>
    Thanks in advance
    Ramachandran Babu
    Edited by: Alvaro Tejada Galindo on Jun 13, 2008 5:45 PM

    Check if there is any copy routine applied in the copy control from order to delivery - transaction VTLA. The routines themselves can be found in transaction VOFM (Data transfer -> Deliveries). LIKP-ZUKRL field contains the split criteria (by the way, check what's in that field on your deliveries).
    It's possible that there is something in the current routine that is forcing the delivery split. Otherwise you can probably use similar approach to make it stop splitting.
    Hope this helps.

  • Fillable Form Fields Created With Acrobat XI Pro on Mac Won't Save on PCs?

    Hi all,
    Apologies if this has been covered already, but I've done a search of the forums that have turned up nothing.
    Briefly, I have created a fillable form with Acrobat XI Pro on a Mac. The original file was created with InDesign CS6.
    Once the fields were created in Acrobat, the file was saved as a Reader Extended PDF.
    The problem is that Mac users are able to fill in the fields and save the PDF, while Windows users are not.
    Any ideas?
    Thanks!

    Anoop9178 wrote:
    Hi Alex,
    Please refer to following forum post.
    http://forums.adobe.com/message/5765569#5765569
    Regards,
    Anoop
    You recommended answer seem to imply that the users are using Preview. When according the OP in that thread makes no mention on Mac except he created the form on Mac everyone else is using a PC. If anyone is using preview that answer would apply. If anyone filled out the form using Preview then follow the advice in the Link
    I would say your using possibly the wrong Font or the wrong version of the font. If anyone has Acrobat on a PC open the form on a PC if the form fields appear as though nothing is there, then see if you can change the font used. Just try anything other than what is listed. See if the text appears.  If it does then you have a defective font or  the Mac and PC don't use the same version.
    On Mac, if you have more than one version of a Font Style, say Aerial Italic for example, issues like this invisible text will happen. Macs don't tolerate more than one version of the same Font.  You can't have two versions of say Aerial Italic or Helvetica Bold or Courier Bold Italic. PCs you can have 50 copies of the same font and it don't matter. The applications just pick one if it happens to be different then That it.
    In Reader or Acrobat you might set to use local Fonts that might clear up the issue On Mac go to Preferences and Page Display:
    Check use local Fonts.

  • Required Windows updates to run/load dlls created with Visual C++ 2013

    I have dlls created with VS2013 C++. Dlls are statically linked with runtime libraries and therefore do not require the redistributable to run on a machine that does not have VS2013 installed.
    I have a test machine with Win7 SP1 64-bit without any windows updates. When I try to load a dll created with VS2013 in an executable on that machine, the code dies. Another test machine with windows 7 SP1 fully updated using windows updates loads the same
    dll without a problem and the code runs fine.
    My question is which windows updates for Win 7 and Win 8  are necessary for dll created with VS2013 to load and run?
    Thanks. 

    I did use dependency walker. In my post above (third post in the thread) I actually state that: 
    "The code crashes(=dies) on the machine without windows updates. I used dependency walker and there are no missing dlls.
    Even if there were missing dlls, which there are none, those would be system dlls, because a machine with fully up to date Win7 loads and executes the code without a problem."
    The dll is statically linked (/Mt flag was used). For a good measure I installed redistributable which did not solve the problem. Besides static linking applies to runtime dlls, not the system dlls.

  • Adopt net price from contract  if po created with referance to contract

    Hi expertise,
    Can any body so kind to find a way for the below requirement of my client:
    When PO is created with reference to contract, the net price of PO should be adopted from the contract & user should not allowed to change the net price of that PO (but allowed to change the quantity).
    Your earlier answer should be highly appreciated.
    Regards,
    Sp sahu

    Hi,
    You should make use of two very helpful options in SAP.
    They are known as the EVO parameter and the EFB parameter. These control what the user can do when generating .
    You configure a combination of flags on each parameter and so control things like "can prices be changed", can the user ONLY create by referencing a document (contract or req etc.)
    They are configured in the following menu path on SPRO
    Materials management > Purchasing > Environment data > define default values for buyers.
    This is the EVO parameter it is well worth reading the help text on the config for this. It explains that you have to then add a parameter (EVO) to the userid (in the normal way that they maintain their userid , or via the config).
    The EVO parametr is quite useful but the EFB parameter is even better, this conttrols what the user can do.
    The menu path  for the EFB is
    Materials management > Purchasing > Authorisation management > Define function authorisations for buyers.
    This is the one that will help with your problem. It works like the EVO parameter and so you add the EVO parameter to the userid and give it the code that relates to one that you have configured (careful the system is case sensitive for these codes, so use upper case or numbers for the codes when you configure them)
    In the EFB config switch on or off the flags that you want (in your case switch OFF the enter conditions and it may help to use an appropriate field selection reference key that makes the fields display only.
    Then when you allocate this parameter to the userid the settings will apply.
    try them out in your play client, they are VERY useful, especially the EFB parameter.
    Steve B

  • Physical Standby Database Creation with RMAN

    Hi,
    I'm in 10g on Linux. I want to create a standby database on another Linux server. I did not find a clear procedure to create it in Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-02
    and niether in Oracle® Data Guard Concepts and Administration 10g Release 2 (10.2) B14239-04
    In the last one chapter 3 sends you to F appendix and F appendix says do nothing before having than all in chapter 3 :
    In F.1.1 page F-2 it is said :
    See Chapter 3 for a complete discussion of physical standby database preparation,including initialization parameter settings. You must perform all necessary preparation tasks described in these chapters before RMAN can successfully create the standby database files and mount the standby database.
    Any way I'm looking for a procedure or clear article to create it.
    Many thanks before.

    Physical Standby Database Creation with RMAN
    Use the DUPLICATE command.
    Check out this metalink doc: Note:374069.1 and Note:118409.1
    Message was edited by:
    STW
    Message was edited by:
    STW

Maybe you are looking for

  • Touch id and fingerprint doesnt work...

    i have trouble with my iphone 5S 16Gb ios 8.1.2... i use this iphone almost 1 year and yesterday i've got problem with the touch id and fingerprint...i try to unlock but the touchscreen and the fingerprint not respons anything...so i restart the phon

  • I have a S10e now with reformatted but now NTFS. I have been told that I can upgrade to Win 7.

    I have updated BIOS from AHCI to Compatible.  I have Windows 7 Home on a bootable flash drive.  When I boot, it boots fine, but after starting, it is looking for a NTFS formatted drive and needs more than 3.8G.   Can anyone help?  Any questions pleas

  • SNP Planned Orders to ECC Process Orders - no PPDS

    Hello Gurus, Is there a way to covert an SNP Planned orders to ECC Prod. orders? Can one switch off the PPDS in APO and still get the MRP/ MPS planning in APO and  and convert those SNP planned orders into ECC orders in ECC Thanks.

  • Htc incredible & comcast email notification

    I just got the HTC incredible.  My question is that when I am at work I have the phone on vibrate. After 1 minute the screen goes into the sleep mode.  How do I get the phone to alert me (via flashing green light and vibration) when I receive an emai

  • Advanced Returns - Return Step (inspectoin document) Unprocessed

    When viewing the Returns Overview screen during the advanced returns process, there are a few documents which we are not using in our process, as they are being handled externally. Yet these documents are marked as incomplete (yellow status) within t