sIFR and dotnetnuke 4.8.1. Movie not showing
Last Post 04/07/2008 2:15 AM by Lee Sykes. 3 Replies.
Author Messages
andyb1979
Nuke Pro
Nuke Pro
Posts:63


--
03/31/2008 10:19 AM
    Hi there,

    I have watched the video tutorials on sIFR and have tried to incorporate some custom fonts in my dotnetnuke site, but with no success so far.

    Currently I am only trying to replace h1, and I get a white block where the heading 1 should be, but no visible text (this white block changes colour when I change the sBgColor value in javascript when replacing tags).

    If I right-click on the white block, I get "Movie Not Loaded..." grayed out on the adobe flashplayer menu.

    The steps I have taken are a bit different from the tutorial, so I will list them here:

    1. I have added sifr.js and sifr-addons.js to the skin directory

    2. I have added the mandator.swf file to the skin directory. This was created from a true-type font using this web-app: http://ianpurton.com/sifr/
        - Note: I have also tried the vandenkeere.swf and tradegothic.swf files included in the sifr 2.0.2 download but with no success.

    3. I have added a third js file to the skin directory called sifr-replace.js. This contains the following code:

    /*	
        Designates which tags to replace with sifr
    */
    
    if(typeof sIFR == "function"){
    
        // This is the preferred "named argument" syntax
        sIFR.replaceElement(named({sSelector:"body h1", sFlashSrc:"mandator.swf", 
    sColor:"#000000", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC",
    nPaddingTop:20, nPaddingBottom:20, sFlashVars:"textalign=center&offsetTop=6"})); };

    4. I have made the changes to the css file as in the tutorials, so the sifr screen and print css sections are in there according to the video.

    5. All three javascript files are included using the code-behind file of the skin ascx control. The process I have done to link to the js files is as follows:


    // Note: This function is called from Page_Load in the ASCX control code-behind
    // file of the skin
    private void AttachJsFiles() { // Add the sifr js files to the HTML page HtmlGenericControl jscript = null; jscript = new HtmlGenericControl("script"); jscript.Attributes.Add("language", "javascript"); jscript.Attributes.Add("src", Path.Combine(this.SkinPath, "sifr.js")); jscript.Attributes.Add("type", "text/javascript"); Controls.Add(jscript); jscript = new HtmlGenericControl("script"); jscript.Attributes.Add("language", "javascript"); jscript.Attributes.Add("src", Path.Combine(this.SkinPath, "sifr-addons.js")); jscript.Attributes.Add("type", "text/javascript"); Controls.Add(jscript);        jscript = new HtmlGenericControl("script"); jscript.Attributes.Add("language", "javascript"); jscript.Attributes.Add("src", Path.Combine(this.SkinPath, "sifr-replace.js")); jscript.Attributes.Add("type", "text/javascript"); Controls.Add(jscript);
    }

    Finally, here's a screenshot of the result I am getting:

    Photobucket



    Any ideas?!
    Sites I made thanks to DNNCreative vids!
    Rock Rhyme & Reason Fest | The Big Match | Calvary Stockport | Stephen Webster
    andyb1979
    Nuke Pro
    Nuke Pro
    Posts:63


    --
    03/31/2008 4:53 PM
    Ahh, I fixed it.

    The script that does the sifr replacement has to be after all other markup has loaded. Hence its put at the end of the skin.

    So I modified default.aspx as per the tutorial, added the script at the end of my skin and it worked

    You may also be interested to know, this tool allows cheap and cheerful conversion of truetype fonts to swf without a copy of flash:

    http://www.artofscaling.com/sifrmaker/
    Sites I made thanks to DNNCreative vids!
    Rock Rhyme & Reason Fest | The Big Match | Calvary Stockport | Stephen Webster
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    03/31/2008 7:05 PM
    Thanks, and I'm glad that you got things working.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Lee Sykes
    DNN Creative Staff
    Nuke Master VI
    Nuke Master VI
    Posts:4945


    --
    04/07/2008 2:15 AM
    glad to hear you got it working, did you read the note that is on the sIFR tutorial page, referring to security issues?

    http://novemberborn.net/sifr3
    (scroll down to revision 278 security update)

    This is for sIFR 3 - not sure if it applies to sIFR2 - but if you are running v3 make sure you are using a revision later than 278.

     thanks,
    Lee Sykes
    Site Administrator
    Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

    Twitter: www.twitter.com/DNNCreative

    Lee Sykes's Facebook Profile


    ---