0 Replies Latest reply on Jul 18, 2011 12:26 PM by haili_tu

    adding new elements to REOPS skin template


      I am working on a player using the RealEyes OSMF Player  Sample(REOPS). I am trying to customize the skin by adding new elements  into one of the skin template. but It failed.


      Here is what I did:

      1. copy asset/skins/OSMF_Sample_Skin.fla to mySkin.fla

      2.  add a new TextFiled element into the Compositions area. I also changed  some existing elements like the captionField. save it and deploy it to  the same folder.

      3. on REOPS/src/com.realeyes.osmfplayer, add a  new actionscript file: ITitleField.as and TitleField.as to create a  class for the new element as following:


      package com.realeyes.osmfplayer.controls
          import flash.text.TextField;


          public class TitleField extends SkinElementBase implements ITitleField
              public var title_txt:TextField;
              public function TitleField()
                  this.visible = true;
                  text = "";

              public function get text():String
                  return title_txt.htmlText;
              public function set text( p_value:String):void
                  if( title_txt )
                      title_txt.htmlText = p_value;
                  trace("set title text: " + p_value);


      4. on REOPS/src/com/realeyes/osmfplayer/view/SkinContainer.as: add the following lines:


              import com.realeyes.osmfplayer.controls.ITitleField;
              protected var _titleField:ITitleField;


              public function initTitleFieldInstance( p_skinElement:ISkinElementBase ):void
                  _titleField = p_skinElement as ITitleField;


              public function setTitleText( p_value:String ):void
                  if( _titleField )
                      _titleField.text = p_value;


      5. on my config file: I added the following:

              <skin path="assets/skins/mySkin.swf">
              <skinElement id="titleField"
                  hAdjust="0" vAdjust="0"
                  scaleMode="stretch" />


      but when I run the REOPS project in flash builder which open a browser to play the video, I got the following error:


      ReferenceError: Error #1065: Variable TitleField is not defined.
          at flash.system::ApplicationDomain/getDefinition()
          at com.realeyes.osmfplayer.model.config.skin::SkinElement/buildSkinElement()[C:\projects\fla sh\OSMF\REOPS\src\com\realeyes\osmfplayer\model\config\skin\SkinElement.as:68]
          at com.realeyes.osmfplayer.view::SkinContainer/_generateInstance()[C:\projects\flash\OSMF\RE OPS\src\com\realeyes\osmfplayer\view\SkinContainer.as:247]
          at com.realeyes.osmfplayer.view::SkinContainer/generateSkinInstance()[C:\projects\flash\OSMF \REOPS\src\com\realeyes\osmfplayer\view\SkinContainer.as:659]
          at com.realeyes.osmfplayer.view::SkinContainer/_generateSkin()[C:\projects\flash\OSMF\REOPS\ src\com\realeyes\osmfplayer\view\SkinContainer.as:689]
          at com.realeyes.osmfplayer.view::SkinContainer/_skinLoadComplete()[C:\projects\flash\OSMF\RE OPS\src\com\realeyes\osmfplayer\view\SkinContainer.as:801]




      Could anyone tell me what I am missing here? Thanks a lot.