Skip navigation
Currently Being Moderated

How to put an MSO inside another MSO

Jul 23, 2012 4:28 AM

Tags: #javascript #indesign_cs5.5 #indesign_cs5 #multi_state_objects #indesign_cs6

Hello all!

An interesting question came up in the following post by Folobo:

 

http://forums.adobe.com/message/4572897#4572897

 

"Is it possible to use a slideshow embedded in a big overlay slideshow?"

 

I'd like to rephrase this question:

 

"Is it possible to put a MultiStateObject (MSO) inside another MultiStateObject?"

 

And further: if the answer is "yes", could we put that to use with the DPS?

 

@Folobo – this is an interesting question. A quick test is showing that you cannot do it in the UI (correct me if I'm wrong).

 

Let's try it this way:

If you have two objects:

1. an MSO #1 (with two rectangles, rectangle #1, rectangle #2)

2. Another rectangle on the page: rectangle #3

 

Now select the two objects and make an MSO out of it (using the "Object States" panel).

You would think, now I get an MSO with two states, state 1 with rectangle #3 together with state 2 with MSO #1.

 

But not so:

 

Result: One new MSO with three states (rectangle #1, rectangle #2, rectangle #3)

 

Hm. I don't give up on that. Let's try it another way:

Could we select at least two objects inside a state of an MSO and make that a new MSO?

 

Sure, We could select two objects inside a state, but since we are *inside* an MSO the "Object States" panel does not show the possibility to make a new MSO. You can only add states or add objects to states…

 

Frustrating. End of story? Maybe…

 

Be forewarned. The following is highly experimental!

 

Let's try it by scripting (ExtendScript/JavaScript).

 

The scripting reference is showing that an MSO "MultiStateObject" object has an add()-method. And further on, that add()-method could be applied to:

 

Document

Spread

MasterSpread

Page

Layer

 

pageItem

 

And that is the key to a possible solution. We could add a new MSO to a "pageItem" object.

 

A simple rectangle should be qualify for a "pageItem" object; and that, of course, could reside in a state of an MSO.

So, we could add a new MSO to a rectangle inside of a MSO!

 

How can we access a rectangle inside a MSO? Easy: We could select it and work with that selection.

 

So let's do that: select the rectangle in the first state of an MSO and run this one-line-script (be sure you did select the rectangle and not the MSO or one of its states:

 

app.selection[0].multiStateObjects.add();

 

We now have an MSO inside another MSO!

 

 

Explanation:

 

A "generic MSO" was added with the add()-function to a selection (the container object: in our case the selected rectangle).

The "generic MSO" is a two state MSO consisting of one rectangle in each state of a very small size (10px x 10px).

At first it is invisible, because it is very likely that it is positioned outside the geometric bounds of its container object (the rectangle).

 

But we can customize this!

Go to the layers palette and select the new MSO, move it inside the geometric bounds of its container object, readjust its size, add states as you wish, populate the states with images, and other objects etc.pp.

 

 

So, what can we do with an MSO inside another MSO? (As I already said, this is highly experimental.)

 

My experiments with that are very fresh. I did not try a lot. But it seems that we could at least autoplay this MSO.

 

I have to test more thoroughly what is possible and what will work with buttons etc.pp…

I really like to hear from you what you will find out and if you can put it to any use.

 

Uwe

 

Message was edited by: Laubender

 
Replies
  • Currently Being Moderated
    Jul 24, 2012 6:16 AM   in reply to Laubender

    @ Laubender

     

    Many thanks, you are a great coder! But i have a problem to try this solution:

     

    How can we access a rectangle inside a MSO? Easy: We could select it and work with that selection. So let's do that: select the rectangle in the first state of an MSO and run this one-line-script (be sure you did select the rectangle and not the MSO or one of its states:

    I have a problem to select the object inside a MSO. I select the state but it's not correct!

    So i think to check the layers pane: but here i see only one layer rectangle (but the rectangle are 3)!

    So: how the select my object to run the script?

     

    Many thanks.

    f

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 10:13 AM   in reply to Laubender

    Many thanks Uwe. Now i understand how to do and i'm happy. All work. Yes, it's not easy but it can be very useful!  Really thanks. f

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 10:43 AM   in reply to Laubender

    Great Uwe! I try!  f

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 24, 2012 9:25 PM   in reply to Laubender

    Hi, Very nice

    I tried that with buttons inside and outside from nested multistate objetcs and works well.

    Now I can do 2 levels in slideshow

    Great

     

    __Felipe

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 12:09 AM   in reply to Laubender

    Hi Uwe

    I've been reading the thread, but still don't understand where the script is attached, I'd love to test this out!

    cheers

    Alistair

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 2:14 AM   in reply to Laubender

    Work well for me!

    Many thanks Uwe!

    Great job!

    f

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 2:43 AM   in reply to Laubender

    Hi Uwe

    You explained the process very well, and I added the script to the panel etc.

    However, perhaps I don't have such good foresight as you, as I'm a bit lost what to do next.

     

    I created a basic 2 state object, red square; blue square. I double click the MSO to select my first red square, then double click your script, and a message pops up to tell me I have created a new MSO.

    But all that has happened is the my 2 squares have lost the colour that I gave them, I can go back in and add the colour again, but what am I supposed to be able to do now?

    Thank you for your generous time, in sharing this with us, I'm very keen to get some realy sexy buttons working with this.

    Cheers

    Alistair

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 7:35 AM   in reply to Laubender

    Uwe, what a star! I've just tried this and it works exactly as described!

     

    It means I can now create an MSO that calls up an image gallery that lets a user swipe from image to image inside of tapping on NEXT/BACK buttons, safe in the knowledge that when the user closes the gallery, the active swipe area is no longer on the page (which would otherwise interfere with page-turning).

     

    Oh joy, I've been looking for a non-Web-view solution to large images in swiping galleries for two years!

     

    Big beer if we ever meet.

     

    Ali

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 7:47 AM   in reply to Alistair Dabbs

    I think using the works “safe in the knowledge” is a bit of a stretch.

     

     

     

    While I admit this is seriously cool, I have my doubts about doing anything like this without official support.

     

     

     

    Bob

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 9:14 AM   in reply to Bob Levine

    Hmm, official support...

    1. "No, you can't do that in DPS"

    2. "Oh dear, please file a bug report"

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 10:22 AM   in reply to Alistair Dabbs

    OK, I'm being less flippant now. This method of nesting one MSO inside another has some notable side-effects.

     

    First is that selecting a group of objects inside an object state and running the script seems to create a new container frame that is the same size as the group's bounding box, putting the nested MSO inside it. While it's possible to navigate the content of this nested MSO via the Layers panel, it becomes tricky and confusing when trying to drill through the on-screen items with a sequence of double-clicks (or even using the Direct Selection tool). I haven't quite worked out what's going on but I plan to test this more tomorrow.

     

    The filesize of the folio I created is suspiciously large. I created a two-state MSO: one with a button, the other to fill the screen with a transparent background. I then used the script to create a nested MSO swipable image gallery within this second state. Just four images in a nested MSO... yet the folio is in excess of 20MB. Even accounting for PNGs at iPad 3 resolution, this is much bigger than it ought to be. A web gallery equivalent, albeit with JPGs, would be a tenth of this size.

     

    Worth further investigation...

     

    Ali

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2012 1:36 PM   in reply to Laubender

    Thanks Uwe, I think I'm getting there! I haven't had any time to create someting to test yet, I'm on CS6 now with 10.7.4

     

    @Ali B I might have to buy you a beer, as I'm not sure I still follow how to appy these principles to create someting cool!

     

    I was thinking of a family tree style button system, in which you need nested mso's to keep revealing and dismissing more and more levels....

    I'll see if a coffee and a few hours quiet thinking helps

     

    Cheers

    Ali G

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 9:46 AM   in reply to Laubender

    Hi there

     

    Even with the helpfull screenshot I can't get that DPS folder in the SCRIPT window. Is this only on CS6? I have try to select as explain but can't see that

     

    Can you send me the indd file ?

     

    Really need to create a MSO in MSO

     

    Minia

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 9:51 AM   in reply to Laubender

    Wow Uwe, that's something to play with ;]

     

    Many thanks for sharing.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 1:33 AM   in reply to Laubender

    Hi Uwe

     

    thank you so much it is really helpful and it works really well as describe

     

    I just send you a private message

     

    Because what I am aiming is to have a MSO 2 in MSO 1 as you shown but also that MSO 2 has a "Go to state" button that link to MSO 1 (one of its states)

     

    and it seems quite impossible to have a GO TO button that links out of its own MSO, even if it is embedded

     

    Please let me know if it's need more clarification/screenshot

     

    Again, thank U

     

    Minia

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 3:14 AM   in reply to Laubender

    Thank U Uwe !!!

     

    I think I don't have other choices than to change my layout..... as the buttons doesn't works as I wanted to (in nested MSOs)

     

     

    Again merci !!!

     

    still awesome for the script !

     

    Minia

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 4, 2012 3:31 PM   in reply to Laubender

    I've been testing a few layouts in CS6 and it all works well on iPad3 via usb. I've only been going one mso deep (so far) and it seems relatively easy once you get your head around how the structure builds.

     

    I've built some slide shows within layouts. i.e. tap preview to enlarge, swipe to engage with content, tap (area on each state) to close, with the swipe areas completely free to navigate once closed. Makes me wish this could become a solid feature within DPS, maybe it should be on the wishlist?! I would honestly use this more if I knew it was stable. Swipe (for me) feels a far better experience to navigate content than a tap, and having swipe areas no go for article navigation has been an irritation to design around sometimes.

     

    Anyhow's i'm going to do more layouts and test a bit more when the new tools are out too.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (3)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points