5 Replies Latest reply: Sep 29, 2014 5:06 PM by Widget King RSS

    Issue with widgetfactory in CP8

    Ryan Landman Community Member

      I have created AS3 widgets int he past for CP5.5 but now that I have CP8 a simple static widget is not functioning as it should. I have a function that sets the width of a progress bar based on the current slide – it seems the main issue is that nothing runs within the override protected function enterRuntime() function. Is there a different way I should be achieving this with CP8?

       

      The widget code is below, any insight would be very helpful.

       

      package {

             

              import widgetfactory.StaticWidget;

         

              public class progressbar_new extends StaticWidget {

             

                  public function progressbar_new () {

       

                  }

                 

                  // THIS CODE SHOULD ONLY RUN IF IN THE CAPTIVATE RUNTIME ENVIRONMENT

                  override protected function enterRuntime():void {

                                 

                      //Set Progress Bar Size           

                      var pcent:Number=cpVariables.cpInfoCurrentSlide/94*100;

                      //Stretch the bar

                      mcProgressBar.scaleX=pcent/100;

                  }

                 

              }

             

          }