Professional Web Applications Themes

cloneModelFromCastMember - Macromedia Director 3D

I am using cloneModelFromCastMember in my parent script(myAvatar) to create dynamic 3D models. The problem is when i use it in frame scripts it failed. I thought it was because i can't use it in frame script. Then i created a parent script and tried and it still fail. Inserting the same line after the cloneModelFromCastMember in my parent script(myAvatar) also fails. Is there like a limit that I can use it? Why is it that it only works once? Funnily enough, it works everytime on the frame scripts, that is until i save my movie, after that it gives ...

  1. #1

    Default cloneModelFromCastMember

    I am using cloneModelFromCastMember in my parent script(myAvatar) to create
    dynamic 3D models. The problem is when i use it in frame scripts it failed.

    I thought it was because i can't use it in frame script. Then i created a
    parent script and tried and it still fail. Inserting the same line after the
    cloneModelFromCastMember in my parent script(myAvatar) also fails.

    Is there like a limit that I can use it? Why is it that it only works once?

    Funnily enough, it works everytime on the frame scripts, that is until i save
    my movie, after that it gives me an error.

    The error each time returns me a "-2147196928" error code. Macromedia doesn't
    publish this code meaning, therefore I couldn't find out what is wrong.

    I appreciate help from people with similar experiences.

    darylku Guest

  2. #2

    Default Re: cloneModelFromCastMember

    you'll have to preload that member. you have to preload before you can clone
    from an external w3d.


    witlox Guest

  3. #3

    Default Re: cloneModelFromCastMember

    I managed to get it to work by forcing a resetWorld on the cast member I am
    cloning from.

    What I don't understand is why I only get a problem with this cast member and
    not the rest of the 6 members I am cloning from. I do not have to force a
    resetWorld on the cast members I am cloning from for each of my 6 cast members.
    Cloning the 6 cast members worked regardless of whether they get cloned first
    or the 7th problematic one get cloned first. This completely rules out any
    lingo error, as mentioned before, the problem arises only after saving.

    Naturally I suspect a problem with the 3d cast, so i replace it and it still
    turns up the same error!

    If the solution is to preload 3d members before loading, why is it that it has
    been working fine for all my 6 cast members all the while? It was only upon
    introducing a new 3d member that I run into the "-2147196928" error after
    saving. All my 3d cast members are internal. I do not believe it is a problem
    with preloading.

    Macromedia, is this a bug?

    darylku Guest

  4. #4

    Default Re: cloneModelFromCastMember

    witlox was right - you do need to proload those castmembers and check that
    their state = 4 before attempting to reference any models within them - the
    error you are getting sounds like it is exactly the lack of preloading
    that's causing your problem.

    I'm continually reminded of this necessity when adding a new 3d member and
    forgetting to update my preloader script :(

    This is the sort of thing you should be doing:

    property logoMember
    on beginSprite (me)
    logoMember = member("logo")
    end beginSprite
    on exitFrame (me)
    if (logoMember.state <> 4) then
    go to the frame
    else
    go to the frame + 1
    end if
    end exitFrame

    Oh and remember to 'unload' the member if it's not required after you've
    done your clonefromcastmembering...

    member("logo").unLoad()



    "darylku" <webforumsusermacromedia.com> wrote in message
    news:c8hm5u$f5j$1forums.macromedia.com...
    > I managed to get it to work by forcing a resetWorld on the cast member I
    am
    > cloning from.
    >
    > What I don't understand is why I only get a problem with this cast member
    and
    > not the rest of the 6 members I am cloning from. I do not have to force a
    > resetWorld on the cast members I am cloning from for each of my 6 cast
    members.
    > Cloning the 6 cast members worked regardless of whether they get cloned
    first
    > or the 7th problematic one get cloned first. This completely rules out any
    > lingo error, as mentioned before, the problem arises only after saving.
    >
    > Naturally I suspect a problem with the 3d cast, so i replace it and it
    still
    > turns up the same error!
    >
    > If the solution is to preload 3d members before loading, why is it that
    it has
    > been working fine for all my 6 cast members all the while? It was only
    upon
    > introducing a new 3d member that I run into the "-2147196928" error after
    > saving. All my 3d cast members are internal. I do not believe it is a
    problem
    > with preloading.
    >
    > Macromedia, is this a bug?
    >

    Gianpiero Colagiacomo Guest

  5. #5

    Default Re: cloneModelFromCastMember

    Thanks, its working now.

    I thought that Witlox had thought I am loading from an external source, like
    loadfile, so preloading doesn't sound logical in that sense.( Well, it still
    doesn't sound logical that I have to preload something that is already in my
    cast !)

    Anyway, it is strange though that my previous 3d cast members worked fine all
    along without any preloading or unloading.

    Well, if it works, it works.

    darylku Guest

  6. #6

    Default cloneModelFromCastmember

    is this function a pain or am I doing something wrong !!!! works one minute
    then not the next - well as soon as I change it at all


    Matt George Guest

  7. #7

    Default Re: cloneModelFromCastmember

    you need to be more specific describing your problem. cloneModelFromCastmember
    works fine for me. sounds like you have success when you first run your movie,
    then when you run it again you get an error. then you change something ane
    again have success. what do you change? are you using resetWorld() to reset
    your w3d cast member every time your movie begins? give more detail and i'm
    sure someone can help you out.

    Ex Malterra Guest

  8. #8

    Default Re: cloneModelFromCastmember

    This was the previous post, but thanks I take the point that it was a
    spurious post

    hello

    I have been messing with Gary Rosenzweig's simple flight sim

    I wanted to load up one of my own models instead of his biplane model

    [url]http://www.director-online.com/buildArticle.php?id=1121[/url]

    The code looks identical but I'm sure I have read something about sprites
    not actually changing sprite number when imported or moved
    this is the line of code that I changed
    -- import plane
    pPlane = pWorld.cloneModelFromCastmember("redship", "redship",
    member("redship"))


    Any how I have spent some time messing about with this and managed to drive
    my flatmates mad so now I'm asking for help before they kill me






    "Ex Malterra" <webforumsusermacromedia.com> wrote in message
    news:d40lc9$938$1forums.macromedia.com...
    > you need to be more specific describing your problem.
    cloneModelFromCastmember
    > works fine for me. sounds like you have success when you first run your
    movie,
    > then when you run it again you get an error. then you change something ane
    > again have success. what do you change? are you using resetWorld() to
    reset
    > your w3d cast member every time your movie begins? give more detail and
    i'm
    > sure someone can help you out.
    >

    Matt George Guest

Similar Threads

  1. using cloneModelFromCastMember
    By Roofy in forum Macromedia Director 3D
    Replies: 0
    Last Post: September 17th, 02:09 AM
  2. using the CloneModelFromCastMember
    By Roofy in forum Macromedia Director 3D
    Replies: 2
    Last Post: September 23rd, 10:20 AM
  3. cloneModelFromCastmember and addChild
    By yogeshhungama in forum Macromedia Director 3D
    Replies: 1
    Last Post: July 22nd, 01:12 PM
  4. CloneModelFromCastmember Problem
    By Roofy in forum Macromedia Director 3D
    Replies: 3
    Last Post: June 20th, 02:59 PM
  5. cloneModelFromCastMember playing up
    By LeeD in forum Macromedia Director 3D
    Replies: 3
    Last Post: August 7th, 10:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139