Professional Web Applications Themes

Clicking 3D model to communicate with flash - Macromedia Director 3D

Hi (was previously Nocky35) I am using a 3D model (as a .w3d) in Director to walk around. I want the user to click on a model (of a building) to be able to show some information. This information is stored in a .swf file. Any ideas on how to go about this? Any tutotials out there that you know of? Thanks, Andy...

  1. #1

    Default Clicking 3D model to communicate with flash

    Hi (was previously Nocky35)

    I am using a 3D model (as a .w3d) in Director to walk around. I want the user
    to click on a model (of a building) to be able to show some information. This
    information is stored in a .swf file.
    Any ideas on how to go about this?
    Any tutotials out there that you know of? Thanks, Andy

    AndrewNock Guest

  2. #2

    Default Re: Clicking 3D model to communicate with flash

    google modelUnderLoc or modelsUnderLoc
    knew-bee Guest

  3. #3

    Default Re: Clicking 3D model to communicate with flash

    Hello,

    You can use the 'Flash Control from Model' behavior in the Chrome Lib to
    have the Flash player playhead jump to a given frame when the user clicks on
    a given model. The model emissive color changes on rollOver and the cursor
    changes to a hand.

    Best regards,
    Karl Sigiscar.

    [url]http://www.chromelib.com[/url]


    Karl Sigiscar Guest

  4. #4

    Default Re: Clicking 3D model to communicate with flash

    Cheers for that, I was using another behaviour that only went to a marker, and
    didn't show a hand etc. This is cool, have had to add some code to go deeper
    into my flash file movie clips, but is sorted now.
    Take a look at the progress!
    [url]http://mmedia.glos.ac.uk/students/mu305/4DI/Andy/VirtualTour.htm[/url]
    (got to click on the 3d to move with arrows).
    Am having problems now (also added in other forum), where the images from the
    flash file are dynamic. And they work ok in director, but not as a shockwave,
    they either not linking or really slow.

    AndrewNock Guest

  5. #5

    Default Re: Clicking 3D model to communicate with flash

    Oh and another thing I want to do to this, if anyone knows....

    Want it so when click on one of the buttons in the flash part, the camera will
    automatically move to a point in the 3d scene.

    Not asking for much am I....? Only got a few weeks to do this, and do more on
    a buggy being able to drive around the scene.... And make more of the scene...
    Oh, and do my diss!!!! Fun!

    AndrewNock Guest

  6. #6

    Default Re: Clicking 3D model to communicate with flash

    Hello Andrew, As you saw, in order to control Flash from Director, you can
    use the 'Flash Control from Model' behavior in the Chrome Lib. However, to
    control Director from Flash, you cannot use a behavior (yet). It requires a
    little bit of code. Now the solution to your problem! 1- Drag'n'drop the
    'Change camera' behavior in the Chrome Lib on your W3D sprite - only one
    instance is needed - in order to be able to switch to a camera using one of the
    behavior handlers: changeCamera(name), previousCamera() or nextCamera(). 2-
    Type the following code (from my head, so there might be some tweaking needed):
    In Director: on getURL me, stringFromFlash set the itemDelimiter = ','
    action = item 1 in stringFromFlash params = item 2 in stringFromFlash if
    action = 'changeCamera' then -- Replace bhvrNum with the actual behavior
    instance number -- To find the right bhvrNum value for the 'Change Camera'
    behavior instance, -- have a look at the Behavior Inspector to see its order
    in the list, index starting from 1 obj = scriptInstanceList[bhvrNum]
    obj.changeCamera(params) -- I call the behavior instance reference obj,
    because a behavior -- is an object in its own right even if it has a visual
    interface for non-programmers end if end In Flash as your button script:
    on(release) { getURL('changeCamera,DefaultView'); } Best regards, Karl
    Sigiscar. [url]http://www.chromelib.com[/url]

    Newt99 Guest

  7. #7

    Default Re: Clicking 3D model to communicate with flash


    The on getURL me handler in Director must be typed in a movie script. If there is already one in your Director movie, you might add the on getURL me handler to it. Otherwise, create a new one.

    Newt99 Guest

  8. #8

    Default Re: Clicking 3D model to communicate with flash

    A developer can greatly benefit from existing behaviors by taking control of
    them, calling handlers on behaviors instances, as he/she doesn't have to
    reinvent the wheel each time, by creating his own. Behaviors are pretty much
    like parent scripts aside from the parameter window. You can turn behaviors
    into parent scripts and vice-versa. Let me know how you go with your project.
    -- of and not in as previously stated action = item 1 of stringFromFlash
    params = item 2 of stringFromFlash Cheers, Karl.

    Newt99 Guest

  9. #9

    Default Re: Clicking 3D model to communicate with flash

    Thanks for that, will have a go at that early next week (am working at the
    chelt races to gain some cash). Will let you know how it goes.
    All our work that we are doing on our module is getting shown at a exhibition
    in May, so any companies that may wish to see our work, let me know, and i'll
    email you with more details!
    Thanks - Andy

    AndrewNock Guest

  10. #10

    Default Re: Clicking 3D model to communicate with flash

    Hi, i've started back on this now after working at the races.
    I've tried some of that code Karl, (firstly, thanks for your help!).

    As I am still relatively new to Director as well, i've still yet to learn many
    things in it. I've used the code on a test button (before passing variables
    from flash etc), and got this

    on mouseDown
    -- change the camera to Pitville (an area of my 3d world)
    obj = scriptInstanceList[41]
    obj.changeCamera("Pitville")
    end

    But get the error:
    'Script error: Variable used before assigned a value
    obj = scriptInstanceList[?41]'

    This is prob really easy,.... thanks


    AndrewNock Guest

  11. #11

    Default Re: Clicking 3D model to communicate with flash

    Hi, Check the behavior instance number 41. Does it correspond to the order of
    appearance of the 'Change Camera' behavior in the Behavior Inspector ? If not,
    it might be your problem. Otherwise, I'm designing a behavior 'Behavior
    Control from Flash UI' usable on a Flash sprite to intercept messages from
    Flash and control 3D behaviors. Cheers, Karl. [url]http://www.chromelib.com[/url]

    Newt99 Guest

  12. #12

    Default Re: Clicking 3D model to communicate with flash

    I have checked that the behaviour for the change camera is 41. Messing around
    with the code at the moment, but to no joy!
    Your behaviour sounds interesting, i'd be happy to give it a try. Can email
    me at
    [email]Nocky35Hotmail.com[/email] or [email]infoandrewnock.co.uk[/email]

    Thanks

    AndrewNock Guest

  13. #13

    Default Re: Clicking 3D model to communicate with flash


    OK, I will send it you as soon as it is up and running.

    Cheers,
    Karl.

    Newt99 Guest

  14. #14

    Default Re: Clicking 3D model to communicate with flash

    Hello Andrew, Sorry about this miss. I forgot that scriptInstanceList must
    be prefixed by the sprite reference. E.g: obj =
    sprite(1).scriptInstanceList[41] The scriptInstanceList property exists for
    each sprite and, as its name implies, it is the list of all behavior instances
    on this sprite. Cheers, Karl.

    Newt99 Guest

  15. #15

    Default Re: Clicking 3D model to communicate with flash


    Check you e-mail Andrew !!!

    Cheers,
    Karl Sigiscar.

    Newt99 Guest

Similar Threads

  1. Problem tyring to communicate with flash
    By shockbyte in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 3
    Last Post: February 24th, 11:54 PM
  2. flash communicate with Ajax in one page
    By demaxism in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: January 28th, 03:14 PM
  3. Flash Projector Communicate with Web Server?
    By directorRookie in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: May 31st, 04:04 PM
  4. communicate with remoting through flash com
    By Kaushik Mukherjee in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: February 26th, 01:09 AM
  5. How can I send data to a Flash file (swf), by clicking on a html link?
    By Odd Keir Sæbø in forum Macromedia Flash
    Replies: 2
    Last Post: January 4th, 04:27 AM

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