Attach movieclip problems

lets say I have a johnny_appleseed_mc and I make some seeds
that over a series of events will grow into apple trees.
the seed_mc is located in my library, and I am loading it
like this:
if(Key.isDown(Key.SPACE)){
this.createEmptyMovieClip("holder" , "100");
holder.attachMovie("seed_mc", "tree_mc",
holder.getNextHighestDepth(), {_x:johnny_appleseed_mc._x,
_y:johnny_appleseed_mc._y -50});
holder.x=johnny_appleseed_mc._x;
holder.y=johnny_appleseed_mc._y;
when i movie the johnny MC, the seed_mc doesn't follow
(good), but when I plant again (another seed) the original seed_mc
in the first position disappears and reappears in the new position
of johnny, as if the first seed was never planted. How do I make
the old seeds stick in place, and still plant new seeds?
(edited for clarity)

Well, I tried making a backup called file 102 (instead of
file 101)
and experimented creating this variation on the code:
i = 1;
k = 2;
onEnterFrame = function(){
itxt.text = Number(i);
ktxt.text = Number(k);
Key.addListener(myListener);
var myListener:Object = new Object();
myListener.onKeyUp = function() {
if (Key.getCode() == Key.SPACE) {
i = i + 0.1;
itxt.text = Number(i);
k = k + 0.1;
ktxt.text = Number(k);
Key.addListener(myListener);
onEnterFrame function() ={
if(Key.isDown(Key.SPACE)){
this.createEmptyMovieClip("holder" , i);
holder.attachMovie("seed_mc", "tree_mc", k,
{_x:Johnny_Appleseed_mc._x, _y:Johnny_Appleseed_mc._y -50});
holder.x=Johnny_Appleseed_mc._x;
holder.y=Johnny_Appleseed_mc._y;
trace("Holder Depth "+holder.getDepth());
//yields 100
trace("Tree Depth "+holder.tree_mc.getDepth());
//yields 101
well it works and it doesn't. For one, the depth jumps a lot
more than I thought it would - instead of +2 per unclick the of the
spacebar, it jumps in some kind of ratio, first 20 or thirty, then
40-50, then later by the thousands. The hold depth stays 1, even
though the seed depth keeps going up.
The seeds "plant", but their's this peculiar pause between
each seed for other actionscript. I put in a "move" actionscript
for the seeds to see if they were interacting, (a +y = 5) and
annihilate (remove clip) when getting to the other side of the
screen. The seeds would load, and wait for the first seed to
travel, annihilate, then move. You could load 20 or thirty seeds in
one spot, they would all wait patiently like divers in line, then
in succession, fly up and disappear.
While this is useful for making incremental "complete the
loop" scripts, it's entirely useless for simultaneous events. If I
set up my seeds to grow over a week period for example, it would
take a year for 52 seeds to work.

Similar Messages

  • Problem loading from an attached MovieClip

    Project: Flash Professional CS5.5 | AS3
    Platform: Mac OSX Lion
    Hello:
    I have a projector that calls on an attached movieclip with the following function:
    function fbtnclicka(e:MouseEvent):void{
    var mc:moduleexit_mc=new moduleexit_mc();
    The functions successfully loads the movieclip.
    I have a button on that movie clip that has the following function:
    function unloadexitb(e:MouseEvent):void {
        var loadera = new Loader();
        addChild(loadera);
        loadera.load(new URLRequest("credits.swf"));
        loadera.x = -479;
        loadera.y = -285;
    But the function does not load the movieclip. It simply closes the projector.
    Any reason why it does not load my movie? By the way it does work if I run the project from the swf but not from the projector.

    I used this:
    function unloadexitb(e:MouseEvent):void {
    var loadera = new Loader();
    loadera.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,errorF);
    loadera.contentLoaderInfo.addEventListener(Event.OPEN,openF);
    loadera.contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
    addChild(loadera);
    loadera.load(new URLRequest("credits/credits.swf"));
    loadera.x = -479;
    loadera.y = -285;
    function errorF(e:MouseEvent):void {
        trace("errorF");
    function openF(e:MouseEvent):void {
        trace("openF");
    function completeF(e:MouseEvent):void {
        trace("completeF");
    and I get this:
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@2ed92859 to flash.events.MouseEvent.

  • How can attach movieclip in run time

    Hi,
    Getting some problem to attach movieclip at run time...............
    I have a shell.swf and at run time i am attaching a template.swf. In template.swf file have mcMenu Movieclip.
    I am unable to access the or attach the movieclip at run time getting this error  (1180: Call to a possibly undefined method mcMenu.)
    that movieclip is not available on the stage.... it is in the library of template.swf file. Need help
    thanks in advance
    flash@dicts

    use the applicationdomain class:
    load(yourswfURL,yourclassString);
    // you don't need to change anything below:
    function load(urlS:String, classS:String) {
        var ldr:Loader = new Loader();
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){loadCompleteF(e,classS);});
        ldr.load(new URLRequest(urlS));
    function loadCompleteF(e:Event,classS:String):void {
        var loadedAppDomain:ApplicationDomain = e.target.content.loaderInfo.applicationDomain;
        var C:Class = loadedAppDomain.getDefinition(classS) as Class;
        var instance:* = new C();

  • Remove attached movieclip in reverse order of placement

    Is it possible in AS2 to remove an attached movieclip instance in reverse order? I want to give the user the ability to click an erase button and remove the most recent instance of an attached movie. I have tried .swapDepths and getting inconsistent results. Here is what I have:
    this.onMouseDown = function(){
    var drawdot:MovieClip;
    drawdot = this.attachMovie("dot", "dot_mc", this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse});
    var nextdepth = this.getNextHighestDepth();
    trace (nextdepth);
    clear_btn.onPress = function() {
    dot_mc.swapDepths(100000)
    removeMovieClip(dot_mc);
    Thanks for your time.

    Perhaps using an array to store the movie clips names that are attached would work. Then you could use the array.pop() method to get the last element entered and remove it from the array at the same time.
    I bolded the lines I changed/added in your code.
    var i:Number = 0;
    var dotArrays = new Array();
    this.onMouseDown = function(){
    var drawdot:MovieClip;
    drawdot = this.attachMovie("dot", "dot_mc" + i, this.getNextHighestDepth(), {_x:_xmouse, _y:_ymouse});
    dotArrays.push(this["dot_mc" + i]._name);
    var nextdepth = this.getNextHighestDepth();
    trace (nextdepth);
    clear_btn.onPress = function() {
    var delete_mc = dotArrays.pop();
    removeMovieClip(delete_mc);
    Let me know if this works ok.

  • Attaching movieClip from Flash(SWF) to Flex

    Hi,
    Please tell me -'How to attach movieClip of Flash file in
    Flex Application ?'
    I shall be very thankful to you
    Hoping for a favorable reply
    Thanks in Advance

    Use the Flex component kit for Flash.
    https://www.adobe.com/cfusion/entitlement/index.cfm?e=flex_skins

  • Only first Attached MovieClip instance 'responds' to keyPress

    I am attaching several instances of a nested MC which has
    some on
    keyPress code. Only the very first instance responds to the
    keyPress
    events. Why don't the other instances behave the same? The
    only
    logical reason I can think of is the subsequent instances are
    at
    different depths, could this be the reason? How can I get all
    instances to respond to the keyPress event?

    odie11,
    > The code I posted has to be attached to an object
    > instance so I nested an instance of a vertical line
    > MC inside another to make a parent movieclip
    > which I can attach or remove at runtime.
    Actually, you don't have to attach that code directly to the
    object (in
    fact, that's been "bad form" since Flash MX, though on() and
    onClipEvent()
    still work fine). I tried to duplicate your issue and was
    able to ... and
    frankly, I can't imagine why each separate instance wouldn't
    follow through.
    First, I thought it might be an issue of focus, but I
    switched focus back
    and forth among the movie clips (by tabbing) and that didn't
    seem to fix the
    problem. It might actually *be* a focus issue, but additional
    testing would
    take more time, and today is a bit tight for me.
    Check out your other options, for sure. Since Flash MX, it's
    been
    possible to assign event handlers from keyframe scripts. That
    way, you can
    attach your movie clips (nested or not) and refer to them by
    the unique
    instance name you give each one as you attach.
    http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Attached Libraries problem with reports

    I have the following problem please help me:
    Report 6i version : Report Builder 6.0.8.23.0 Patch 14
    I am running on C/S not on the web
    the problem is:
    If I have the follwing:
    1) a report r1.rep
    2) and a PL/SQL library c:\x\lib_reports.pll c:\x\lib_reports.plx
    3) and another copy of this library on c:\y\lib_reports.pll c:\y\lib_reports.plx
    4) and REPORTS60_PATH environment variable contains c:\y
    then when I attached this library to that report and
    choose YES when asked to remove the non-portable path then call this report from a form I receive the following error:
    REP-1401: 'f_print_dateformattrigger': Fatal PL/SQL error occured.
    ORA-06508: PL/SQL: could not find program unit being called
    but if i choose NO when sked to remove the non-portable path then call this report from a form it works OK, but if i want to put this report on other machine and put the library on other directory for example c:\y and put this path in REPORTS60_PATH I receive the following error:
    REP-0756: Warning: Unable to find PL/SQL library 'c:\x\lib_reports.pll'.
    please help me because I need to publish my reports to other machines and different directories.

    I am having the same problem now in 10g.
    The report and it's attached library are both saved, compiled (ctrl+shift+K) and generated succesfully. However, when running the report in runtime the following error appears:
    REP-1247: There exist uncompiled program unit(s). REP-1247: Report contains uncompiled PL/SQL.
    When i remove the .plx-file, it works although the generation of the plx-file works without error. The generating and runtime are both done on the same database with the same user.
    Anyone have an idea why this is happening?
    PS: Is it normal that i have to generate the library in Forms? Reports doesn't seem to be able to open .pll-files.

  • Mail attachment saving problem

    Hi,
    When I tried to save a Mail attachment today I got the following warning:
    Mail was unable to save the attachment “File.numbers” to disk. Please verify your downloads folder exists and is writable.
    The warning must be wrong because other attachments, even of the same kind, can be saved without problems. I observed that only such files are effected which contain subdirectories like numbers, keynote, etc. and my suspicion is, that the saving problems may come from wrong file reading/writing rights within these subdirectories, that the sender of the Mail may have imposed to prevent unwanted changes to his/her file. May this be so? Otherwise, what else?
    (MacOs X 10.5.6, Mail.app 3.5 and, in this particular case, Numbers08)
    Thanks for for help in advace!
    Joe.

    Hi Kappy,
    Nothing at all. No error message but no copying either, and no change in the curser appearance when dragging to the Desktop.
    When I go to Mail --> Message --> Forward as Attachment, the attachment in the composer window can be saved like a normal file and has an appropriate size, eg. the desired original file seems to be contained in there. However, I have no Idea how to extract the original .numbers file from that.
    Strange, isn't it?
    Thanks,
    Joe.

  • PDF Attachment preview problem

    Hello,
    Can some one advise me why would there be a problem in viewing pdf attachment properly.The problem is when I try to open a PO attachment that is sent via SAP or preview it in SAP itself, the content seems to vanish when scrolling up and down the document.The print program has been used before for a diiferent output type and it worked good and still is working very well.Thanks.
    Regards,
    Pinky

    There are two reasons I can think of off hand that would cause a problem.
    1) Email is a method of sending ascii information through the internet.
    Since attached files are not necessarily ascii, different methods of
    encoding the attachment and converting it to ascii have been developed.
    Both the receiving and sending email programs, must understand the
    method of encoding used. If not you are out of luck.
    2) If the people are trying to read their mail at work, their employer
    might have a policy of either not allowing attachments. They can either
    reject all mail with attachments or they can strip the attachments from
    the email.
    ...Mike

  • Attachment open problem in Internet Explorer

    It's a very strange and annoying issue that we already have for several months and still don't now how to work around it. Problem appears on opening attached files via the attachment tab. Sometimes all going well but sometimes we get errors like "IE cannot display the webpage". All may works fine during plenty large amount of time but in some point problem may appear again. We can save attachments via appropriate button and open them after that - it always works fine, but it's not a very good way for end users. May be somebody knows what can be a reason of such behaviour.
    It happens on different LC configurations. The main server works on RHEL 5.5, but I also reproduced that problem on my Windows 7 based local machine. All times it was Weblogic 10.3.6 and LiveCycle ES3. Any help are greatly appreciated.

    Still no ideas? May be some screenshots can help you to understand a point of issue. At least they are a bit more clear than my English
    Trying to open an attachment (.xls file)
    Error message in MS Excel (text on Russian - "unable to open")
    The next error, it appears after clicking "ok" in previous dialog box.
    Sorry for a lot of Russian text. It means next:
    Application MS Excel unable to get access to a file <file>. It may be initiated by one of next reasons.
    Using of nonexistent file or path
    File is using by another program
    The name of opening book coincides with name of already opened book
    Any suggestions?

  • SOAP Message Attachment MIME Problem

    Hi there,
    I'm having problem trying to send a binary file with SOAP.
    I can send an XML Doc (MIME type text/xml) but when I try to put the ByteArrayInputStream that holds the binary file and the content to application/octec-stream
    I got this exception:
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octet-stream
         at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:851)
         at javax.activation.DataHandler.writeTo(DataHandler.java:305)
         at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1089)
         at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:635)
         at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
         at com.sun.xml.messaging.soap.MessageImpl.saveChanges(MessageImpl.java:371)
    Anyone had this problem ?
    Any work around ?
    Or this is a problem because the JAXM is not fineshed yet ?
    Thanks,
    Marcio

    Hey guys... I pray you are all still listening.
    I have been on the most mind numbing cookie trail ever (I'm blatantly lying - I'm a Java programmer!) following these blasted exception trails to an 'Unknown Source'
    After initially reading this thread I quickly knocked up ObjectDataSource as follows:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.io.OutputStream;
    import java.io.Serializable;
    import javax.activation.DataSource;
    public class ObjectDataSource
    implements DataSource
         public static final long serialVersionUID;
         public static final String CONTENT_TYPE;
         static {
              serialVersionUID = 42L;
              CONTENT_TYPE = "application/x-java-serialized-object";
         } // end static initializer
         private byte[] objectBytes;
         private String contentId;
         public ObjectDataSource(Serializable object, String contentId)
         throws IOException
              if (contentId == null || contentId.equals(""))
                   this.contentId = object.getClass().getName();
              else
                   this.contentId = contentId;
              ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
              ObjectOutputStream ooStream = new ObjectOutputStream(baoStream);
              ooStream.writeObject(object);
              ooStream.flush();
              ooStream.close();
              objectBytes = baoStream.toByteArray();
         } // end primary constructor
         public InputStream getInputStream()
         throws java.io.IOException
              ByteArrayInputStream baiStream = new ByteArrayInputStream(objectBytes);
              return new ObjectInputStream(baiStream);
         } // end getInputStream
         public OutputStream getOutputStream()
         throws java.io.IOException
              throw new IOException("Cannot write to this stream");
         } // end getOutputStream
         public String getContentType()
              return CONTENT_TYPE;
         } // end getContentType
         public String getName()
              return contentId;
         } // end getName
    } // end ObjectDataSource classand use it as follows:
    AttachmentPart attachment = soapResponse.createAttachmentPart();
    ObjectDataSource ods = new ObjectDataSource(requestedObject, null);
    attachment.setDataHandler(new DataHandler(ods));
    attachment.setContentId(ods.getName());
    soapResponse.addAttachmentPart(attachment);
    soapResponse.saveChanges();... this is within my 'SOAPServlet extends JAXMServlet' servlet, which happens to work fine when testing the servlet outside a web-container. But testing with Tomcat 5.5.x It doesn't work... infact, it damn well dissappears. I try readObject after retrieving and casting the InputStream to an ObjectInputStream from the AttachmentPart, but I get a:
    Exception in thread "main" java.lang.ClassCastException: java.io.ByteArrayInputStream which is totally bizzare!
    So I do a bit of investigation to discover ....
    application/x-java-serialized-object
    java.lang.String
    javax.mail.internet.MimePartDataSource
    java.io.ByteArrayInputStream
    0 // this would be the available bytes in the ByteArrayInputStreamNow the first two lines confirm my ObjectDataSource is there somewhere or that that data was sent over the wire (ha, i'm on the same damn machine), but where the hell did MimePartDataSource come from?
    I have previously encountered the various exceptions including java.io.EOFException when trying to read from the byte stream and java.io.StreamCorruptedException when wrapping that byte stream with an object stream.
    These setbacks have royally ****ed my project; cahnces are slim that it will get finished. I'm ready to give up.
    Any help will be appreciated?
    Warm regards,
    Darren B

  • File attachment download problem with Chrome

    hi,
    I've been searching for a cure to this problem for days without success. Hopefully someone here will help me fix this annoying problem.
    The problem:
    1. First: When using Chrome (lastest as of today) to open an attachment in emails, Chrome
    always saves the file as download.xyz where xyz is the extension.
    2. Second: Sometimes it saves the file extension correctly, sometimes it just changes to something else like htm, ashx,... where the correct extension should be .doc or .xls.
    I find this only happen with MS Office attachment files. Other browsers like Firefox, IE work just fine.
    What is the problem and possible solution/work around for this?
    We are using MS Exchange 2010 btw.
    Thank you

    Hi Trung,
    Try disabling plug-ins in Chrome and see if it works, if works you can pin-point out the exact plug-in causing the issue.
    Type this in the chrome browser's address bar: 
    about:plugins
    Reference:
    Chrome: Attachments save as attachment.ashx and a number
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Apple mail attachment encoding problem

    I'm having the problem lately that either attachments aren't being decoded properly and the source is displayed in the email or that the entire email is being displayed like this:
    --Apple-Mail-7--951337123
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=ISO-8859-1;
    delsp=yes;
    format=flowed
    FYI
    --Apple-Mail-7--951337123
    Content-Transfer-Encoding: base64
    Content-Type: application/octet-stream;
    x-mac-type=584C5338;
    x-unix-mode=0744;
    x-mac-creator=5843454C;
    name="report.xls"
    Content-Disposition: attachment;
    filename=report.xls
    0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAA
    EAAAQAAAAAEAAAD+////AAAAAAAAAAD/////////////////////////////////////////////
    We have the same problems with UTF-8 encoded mails. If I select the Inbox, then select Mailbox -> Rebuild it fixes it, but I need a better solution to fix this. Several others are having the same problem and it seems to be happenning intermittently.
    Anyone have any suggestions?
    macbook pro 1.86Ghz   Mac OS X (10.4.5)  

    duren wrote:
    Some of my clients cannot open these inline images.
    This clients use presumably Outlook 2007. It's not your or Apple Mail's fault, it's a known bug in Outlook 2007 and there is also a Microsoft Help and Support Article from April 2007 about that issue.
    Here -> http://support.microsoft.com/kb/917120
    A workaround is also described there.
    A simple ad hoc solution is to ZIP the pictures before attaching to mail
    Lupunus

  • Mail attachment path problem

    hi experts
    i am trying to send mails with attachments thru jsp.
    i have this normal jsp file i.e the html form is not set to enctype="multipart/form-data" ok
    now i have some <input type="File" name="attachment1"> in this file
    when i browse and attach the file and submit
    i call my sendmail.jsp.
    here i had done
    String attachment1 = request.getParameter("attachment1");
    the only problem i'm facing is i get only the filename in the attachment1 variable
    instead of full path
    how can i do this.
    Note: when i hard code the path in sendmail it works fine.

    Hello,
    We are implementing digital signature on form 16.
    We configured the ADS for the same.
    In  transaction pc00_40_f16, we provide the path for saving the form and also provide the name of ADS connection. When we  click on the print form button,  the forms are generated with 0 bytes.
    Can you please guide us if have resolved this kind of issue or other settings are required to get the form 16 with digital signature.
    Regards

  • Mail attachment charset problem

    Hello,
    I have made a program which is able to send Icalendar files as an attachment. I get the data as an InputStream.
    My problem is that the Icalendar file doesn�t show the letters '�', '�' and '�'. I have tried to use iso-8859-1 in the MimeBodyPart headerline and in the ByteArrayDataSource, but it doesn�t work?!
    Where can I specify which charset I want to use?
    MimeBodyPart mbp3 = new MimeBodyPart();
    mbp3.setFileName( m.getAttachmentFileName() );
    mbp3.setHeader("Content-Class", "urn:content-classes:calendarmessage");
    mbp3.setHeader("Content-ID","calendar_message");
    mbp3.addHeaderLine("charset=iso-8859-1");
    java.io.InputStream inputStream = null;
    try {
          inputStream = m.getAttachmentFile().getBinaryStream();
          mbp3.setDataHandler( new DataHandler( new javax.mail.util.ByteArrayDataSource( inputStream, "text/calendar;charset=iso-8859-1;method=REQUEST" ) ) );
    catch ( Exception e ){}
    mpRoot.addBodyPart(mbp3);

    Yes you are right... Thank you.
    I removed the line:
    mbp3.addHeaderLine("charset=iso-8859-1"); - and now the letters are shown correct when opening the ICalendar file using a text editor.
    But when openning the file using Outlook the letters '�', '�', '�' are removed?! I know that isn�t a problem in my mail code but certainly in the iCal file?!

Maybe you are looking for

  • How to create an instance of midlet with in a midlet

    Hi all, I have 5 midlets in the same project (midlet suite). I need one of the midlets (login midlet) to start and when login is verified i want to display list of the remaining midlets which can be launched as per user's chioce. My query is, how can

  • I have used the write jpeg file from intensity but image colours are different

    Here are the relevent files for my program. Insert these values x1=218 x2=368 y1=45 y2=45 r=39 in order to run adn crop the pictures I hope someone can help Attachments: 218_368_45_39.jpg ‏23 KB 2ColourProgram.llb ‏355 KB

  • Disk on port 0 at risk..

    on startup I get a message saying that my Harddrive is at risk, i pressed continue and this has been going for about a month or two now. I get the message "disk on port 0 at risk" on the bottom right corner of my screen, but I havent encountered any

  • Printer printing garbage text

    I have an Officejet Pro L7580 All-In-One, connected to a desktop computer running Windows XP. I've a rather strange problem that has happened sporadically in the past, and recently more freqently. When printing information from the web (as far as I c

  • GPU Acceleration in Chromium causes heavy system load

    I experience a heavy system load (especially if I'm watching videos or listening to music on soundcloud) if I use the hardware acceleration feature in Chromium. I use the standard linux kernel(not the lts one) and the drivers from the nvidia-package.