Prevent Cache of SWF Files and Xml Content in Flash

by Nathan 19. August 2009 09:17

 

If you like the flash player to expire the content of the SWF file add the following line between your <HEAD></HEAD>  tags

<META HTTP-EQUIV="Expires" CONTENT="Mon, 04 Dec 1999 21:29:02 GMT">
for more information check out: 
http://kb2.adobe.com/cps/147/tn_14743.html 

 

To prevent flash caching xml data, you can use the cache manager extension. It basically adds a timestamp to the querystring so it looks like a unique request.

 

You can download this from here:

http://www.communitymx.com/content/article.cfm?cid=827ea

Once you install the extension the usage is quite simple:

xml.load(CacheManager.uncacheURL(XmlFileLocation));

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Flash

Debugging in Flash using Trace

by Nathan 30. July 2009 09:51

 

Sometimes you will need to debug your flash application when its running live, for example if you are using server side scripts that are giving an Xml Response etc.

There is a way to output this information to a text, so you can have trace("Testing Response:" + myVariable); etc

 

1. You have to uninstall the original flash player you hav

2. Download the Debugger Version of Flash (You can get this on the Adobe Website)

3. For Windows XP add a file called mm.cfg to your X:\Documents and Settings\(UserName)

Inside the file add the following lines:

MaxWarnings=0
ErrorReportingEnable=1
TraceOutputFileEnable=1

4. You will then be able to find the output in the file  X:\Documents and Settings\(UserName)\Application Data\Macromedi\Flash Player\Logos\flashlog.txt

I usually run this in a program like textpad so it will bring up the file changes automatically.

 

NOTE: To stop the output you can go to publish preferences and select omit trace actions (This will stop people reading your trace information)

 

It is also possible to out the data using External Interface calls to Javascript, I will write more on this soon.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Calculating Elapsed Time ActionScript

by Nathan 27. July 2009 09:58

 

function calculateTimeElapsed(startTime:Date,endTime:Date) {
    
    var sHours = startTime.getHours();
    var sMinutes = startTime.getMinutes();
     var sSeconds = startTime.getSeconds();
    var sMilliSeconds = startTime.getMilliseconds();

    var eHours = endTime.getHours();
    var eMinutes = endTime.getMinutes();
     var eSeconds = endTime.getSeconds();
    var eMilliSeconds = endTime.getMilliseconds();
    
    var sTimeSpan = (sHours*3600*1000) + (sMinutes*60*1000) + (sSeconds*1000) + (sMilliSeconds);
    var eTimeSpan = (eHours*3600*1000) + (eMinutes*60*1000) + (eSeconds*1000) + (eMilliSeconds);
    return eTimeSpan - sTimeSpan;
    
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Flash

Dynamically Creating Movie Clips in Flash

by Nathan 16. July 2009 05:19

var myText:TextField;

for (var i:Number = 1; i<6; i++) {
        this["clip"+i] = new MovieClip();
        this["clip"+i].graphics.beginFill(0xFFFF00);
        this["clip"+i].graphics.drawCircle(40, 40, 40);
        this["clip"+i].x=i*80;
        myText=new TextField;
        myText.width=250;
        myText.height=250;
        myText.text="clip" +i;
        myText.x=10;
        myText.y=20;
        this["clip"+i].addChild(myText);
        addChild(this["clip"+i]);
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Flash

Clearing All Textbox Programatically in ASP.NET Web Form

by Nathan 15. July 2009 11:04

There are multiple ways of doing this ie using JavaScript, but this is the server side solution.

You can adapt this method for several other solutions:

        foreach (Control c in this.Page.Controls)
        {                        
            if(c.GetType().FullName.Equals("System.Web.UI.HtmlControls.HtmlForm")) {
                foreach (Control cForm in c.Controls)
                {                        
                    if(cForm.GetType().Equals(typeof(TextBox))) {   
                        ((TextBox)(cForm)).Text = "";
                    }
                }
            }
        }

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

SQL UPDATE INNER JOIN

by Nathan 13. July 2009 06:41

 

If you want to update the data in a table by getting information from another table.  You can acheive this by using an update inner join query.

For example if i wanted to update the phone numbers in my table using a list of contacts from a secondary table, the UPDATE INNER JOIN Query would be like the one below:

UPDATE c
SET c.PhoneNumber = c2.PhoneNumber
FROM Contact AS c
INNER JOIN ContactTable2 c2 on c.Id = c2.Id
WHERE DateCreated > GETDATE()-60

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SQL

SWFObject 2.2 Released

by Nathan 23. June 2009 08:09

 

SWFObject 2.2 has been released and has a number of new features.

1. Improved DomContentLoaded emulation for Internet Explorer
2. Dynamic library support
3. Callback method for embedding Flash content
4. No more embed tags
5. Improved Flash Player version detection for non-Internet Explorer browsers
6. Improved Adobe Express Install
7. Improved createCSS method
8. Detected user agent properties are now public via the swfobject.ua object
9. No more conditional compilation directives
10. The option to switch off SWFObject's default show/hide behavior

 More information found here

http://code.google.com/p/swfobject/wiki/whats_new

 

 

An example to implement with javascript  is:

         <div id="flashHeader" style="height:200px">

Alternative Content

        </div>

        <script type="text/javascript">
            swfobject.switchOffAutoHideShow();
            swfobject.embedSWF("flashFile.swf", "flashHeader", "800", "180", "9.0.0", "expressInstall.swf");
        </script>  
 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Flash

Selecting Default Values on Dropdown Lists

by Nathan 2. June 2009 10:17

If you would like your application to set the selected item in your dropdownlist to an item from a variable passed to it, or from the database

Here are some examples:

 

ASP.NET 

<asp:DropDownList ID="DropDownList1" runat="server"/><br />

DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(value.ToString()));

 

VBScript ASP Example:

 

  response.write "<select size=""1"" name=""selectData"" id=""selectData"">"
  response.write "<option value='0'>-- Select  Data --</option>"
  do while not objRs.eof

      if (ContactType = objRS("Value")) then
          response.write "<option value='"+cstr(objRS("Value"))+"' selected>"+objRS("Description")+"</option>"
      else
          response.write "<option value='"+cstr(objRS("Value"))+"'>"+objRS("Description")+"</option>"
      end if

      objRs.MoveNext
  loop
  response.write "</select></font></p>"

 

If you have a lot of variables i suggest using a for loop:

 

    response.write "<select name='select1'>"

    Dim MyWebSiteArray
    PrefOddsArray = MyWebSiteArray("web design","design","website","nathan","baker")

    For each Item in MyWebSiteArray

   DatabaseValue = RS("ValueFromDatabase")


   if(DatabaseValue = Item)  then
        response.write "<option value="""+Item+""" selected>"+Item+"</option>\n"
    else
        response.write "<option value="""+Item+""">"+Item+"</option>\n"
    end if
    Next
    response.write "</select></td>"
    response.write "</tr>"

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

ASP | ASP.NET

Using Recordsets ASP / VBScript

by Nathan 29. March 2009 08:45

 

If you receive this error 

ADODB.Recordset error '800a0e78'

Operation is not allowed when the object is closed.

you will need to check the state of the recordset as in the code below before you access any properties of the object

 


if not oRs.state <> 1 then

        if not oRs.eof then

              if oRs("Value").Value > 0 then
                 myval = oRs("Value").Value
            else
           myval = 0     
            end if
        end if
    else
        Response.Write "Cannot find any records"
    end if
   

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

ASP

Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.

by Nathan 29. March 2009 08:42

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The entry 'ScriptModule' has already been added.

Source Error:

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


This happens when the config for a virtual directory is already defined in the root web application

There are two ways you can fix this:

<remove name="ScriptModule" />

Alternatively you can stop the  the web.config inheritance to the the virtual directory.
by adding this to the parent web.config

    <location path="." inheritInChildApplications="false">
    <system.web>
    ...
    </system.web>
    </location>

 

I found out that the root application had .NET 3.5 references in the web.config

I tried to remove this using:

    <location path="." inheritInChildApplications="false">
    <system.web>
    ...
    </system.web>
    </location>


the problem actually occured due to the  3.5 reference in the <configSections>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

I am a Website Developer and Designer based in Sydney, Australia. I have experience in developing websites and applications using various languages including C#, VB, C++, Flash (ActionScript), SQL and Linux. You can see some of my projects at www.nathanbaker.com.au

Page List