Skip to main content
CSXGuy
Participant
January 9, 2014
Answered

Captivate 7 - Shrinking Smart Shape Buttons II

  • January 9, 2014
  • 12 replies
  • 1821 views

Since my last question was a little difficult and no one seemed to be able to help I'm hoping to receive a better response on this one as it is most definitely a little easier to explain and I think will be simpler to troubleshoot.

I was able to create a .swf with smartshape buttons that keep all the smart shape buttons at their needed size but once I load them into our LMS/Flex Wrapper the buttons contine to shrink per click (I think this is because Adobe Flash Player doesnt know what to do with it).

My solution is I'm trying to find a way to either do one of the following two things (reload or "refresh" the button in advanced actions after a click so that it will always have the first click sizing) or ...

The second is a little more involved as I found that the sizing happens on the 'down' action of the button and not the 'click'. This means that if I could remove the 'down' graphic functionality from my smart shape buttons and keep the up and click actions in theory the button might work and not cause the image shrinking...

Thoughts....

Anyone....

Thanks,

Stephen

This topic has been closed for replies.
Correct answer CSXGuy

Thanks Jabir, I emailed you the requested information and any insight you can give me on this is greatly appreciated.

Rick,

I will send them a request and see what I can get accomplished.

Thanks for all the help!

12 replies

Participant
June 4, 2019

I realize this is an old thread but it seems this issue persists.  I'm currently using CP 2017 Release (V10.0.1.283).  Even without a Down state in the State View, smart shape buttons STILL "shrink" when selected.  What happens is the shape is forcibly getting scaled with CSS using (transform: translate(x,y), scaleX(x), scaleY(y)).

This forced design is handled in CPM.js under a function called "cp.AutoShape.prototype.shrinkShapeButton".  This is the offending line of code within this function:

c="translate("+c.tx/cp("div_Slide").scaleFactor+"px, "+c.ty/cp("div_Slide").scaleFactor+"px) scalex("+c.sx+") scaley("+c.sy+")";

To prevent your smart shape buttons from "shrinking" when selected, comment out that line of code using a comment block.  This way, if you (or your customer) decide to put it back in, you can simply remove the comment block (non-destructive editing FTW).

NOTE: CPM.js is found in the /assets/js folder of your published course.  This JS file is minified, meaning it is intentionally difficult to read and understand.  However, opening this file with a basic text editor and using the search function, the above line of code should be easy to find within the mess.  Once found, comment out the line using a comment block.  What this looks like is below.  "/*" is added at the beginning of the line, and "*/" is added at the end (after the semicolon).  Code between this "block" is ignored.  This method is typically used to comment out multiple lines of code or to insert multi-line comments but works well to isolate this and only this line of code.  For further information on JS comments, see this link: https://www.w3schools.com/js/js_comments.asp.

/* c="translate("+c.tx/cp("div_Slide").scaleFactor+"px, "+c.ty/cp("div_Slide").scaleFactor+"px) scalex("+c.sx+") scaley("+c.sy+")"; */

Andy_K_nz
Inspiring
September 17, 2014

Hi Stephen,

Did you get any response from Adobe about this bug, because that is exactly what I think it is. I've just been doing some investigation in to this issue because of a project that I'm currently working on has a similar problem. My testers are clicking on the very edge of a smart shape button and when releasing it the attached action does not work because the mouse cursor is no longer over the shape area due to shrinkage.

I resolved this issue by increasing the stroke width of on the Down State of a button but while testing more we found that we could continually shrink the button down to almost nothing.

AndyK

CSXGuy
CSXGuyAuthor
Participant
October 6, 2014

Hey Andy, we have yet to find a solution to this and unfortunately don't have a solid answer for you. If you come up with anything please share as I would love to add this back to our team.

Thanks,

StephenT

Andy_K_nz
Inspiring
October 6, 2014

Hi Stephen,

I don't think there is any simple solution to this and the problem needs to be addressed by Adobe. The solution that I've applied (In CP8) seems to be working for when users accidentally click the edge of a smart shape button. What happens at this point is the button shrinks and the user's cursor is no longer under the active area of the smart shape and the action attached to the smart shape does not fire. In some situations I have noticed that the smart shape button has continued to shrink with each click that does not fire the action.

I have found that this issue is partly resolved in CP8 with the introduction of different button states. If I use smart shapes as buttons in CP8 I make sure that I apply Rollover and Down states for my buttons. Where possible provide a slightly larger stroke width to the down state which increases the size of the button so that when the default shrinkage happens on the down state the additional stroke width compensates for this. This appears to have solved the problem for me with the actions not firing and to some degree the shrinkage issue. If you are still on CP7 then I sorry this does not provide you any real help but I hope that it gives you some other ideas to work on.

AndyK

Participating Frequently
January 9, 2014

Hi Stephan,

Is the issue happening outside your Flex /Lms.Does it happen when you normally publish or preview your project.If so please send me your project.

My email address is jabk@adobe.com.

CSXGuy
CSXGuyAuthorCorrect answer
Participant
January 9, 2014

Thanks Jabir, I emailed you the requested information and any insight you can give me on this is greatly appreciated.

Rick,

I will send them a request and see what I can get accomplished.

Thanks for all the help!

Participating Frequently
January 10, 2014

Hey Stephan,

I would be better if you send me the cptx file of your project and also the details of your lms.

Captiv8r
Legend
January 9, 2014

Hi Stephen

Couple of things here.

First (and this is important) you need to report this behavior as a bug using the Wish Form you find at

http://www/adobe.com/go/wish

Second, to my knowledge there are no "images" used for Smart Shape buttons. Thus, no "down graphic" to maintain. Whatever is happening is likely happening programmatically in the AS code being used.

The only suggestion I can think of here is to avoid using Smart Shapes as buttons. It should be easy to test, Just replace one of them with an Image button. Now Image buttons DO actually have multiple images. One for up, down and over. My guess is that the problem will go away if you use image buttons.

Cheers... Rick

CSXGuy
CSXGuyAuthor
Participant
January 9, 2014

Hey Rick,

Thanks for the quick response.

I have no problem reporting this as a bug, I have seen a couple places where people have brought it up but for the sake of redundancy I can as well.

The problem isnt that my buttons dont work or that another button wouldnt do the job (I would use a image button here without issue). I need to find a workaround or 'trick' that will allow me to use smart shape button as that is what my client is asking for (The ability to use Smart Shape buttons in our LMS).

I also mentioned that a possible fix would be to remove the button and re-add the button after each click in Advanced Actions or Javascript. Is there a way to do this in Captivate 7 and hope it resets the buttons graphic?

Thanks,

Stephen

RodWard
Community Expert
Community Expert
January 9, 2014

You mention that you are using some kind of custom Flex wrapper to integrate your content with your LMS.  I think it most likely that something in the code of this wrapper is interfering with the operation of the objects in the Captivate child SWF. 

So perhaps what you SHOULD be doing here is getting onto the AS3 developers that created this wrapper and get them to do some investigation and testing to determine why their code might be having this effect.  I've not seen this issue occur in normal LMS integrations.