Published at January 3, 2008
in Web and Flash.
This is in response to this post: http://www.castlesblog.com/2006/09/18/flexfm/
Flex file manager was something that I wrote with a demo version of Flex 2 and never really finished it. To my surprise I have had quite a few requests for the source code so I’ve finally gone and found all the files and packaged them up so you can download them from my website.
It uses a very old version of amfphp and only uses amf0 (I couldn’t quite work out how to do amf3 at the time). I think amfphp supports amf3 now so if someone is interested, they might want to modify it.
As for copyright stuff.. There are no restrictions on what you use as long as I (Marc Castles - www.castlesblog.com) get a mention in the credits if you use my source code.
The file manager was never really finished and I don’t even know how secure it is. I’m sure there are heaps of bugs so I wouldn’t suggest using it in a production environment.
Best of luck with it!
Download Flex File Manager
I’ve been using Motion on and off for more than a year now and I’ve only just discovered this little quirk with text rendering - Point Size Affects Text Filters Quality.
When laying out text in a project I normally type the text using the text tool at something like 10pt and scale it up to the size that I think looks good. This works fine and looks great but as soon as you add a filter things can go wonky. It appears that when you scale up text using the distort nodes it doesn’t change the point size so filters are applied as if the text is still 10pt or whatever point you started at. So what does this mean? Basically the text changes from lovely clean vector shapes to ugly blocky bitmaps. Check out my example:

Both Elephant text is the same text but the first one is scaled up and the second one is scaled down.. notice the bloom effect (with default settings) create a very different result!!
So what is the lesson learnt from all this? Don’t scale up text using the nodes.. scale text using its point size and you will have sharp looking effects text all the time!!! … unless of course you want blocky pixelated effects???
Published at December 6, 2007
in Web.
By default the fckeditor file browser that comes with it doesn't allow file deleting or folder deleting because of the security risk. Its a bit of a pain but it is possible to get the file browser to delete files. Here is how I went about it for php:
edit "editor/filemanager/connectors/php/commands.php" and add:
PHP:
-
function DeleteFile( $resourceType, $currentFolder ) {
-
$file = $_SERVER['DOCUMENT_ROOT'].$_GET['FileUrl'];
-
-
-
} else {
-
echo '<error number="1" originaldescription="unable to locate file">' ;
-
}
-
}
-
function DeleteFolder( $resourceType, $currentFolder ) {
-
$folder = $_SERVER['DOCUMENT_ROOT'].$_GET['FolderName'];
-
-
DELETE_RECURSIVE_DIRS($folder);
-
} else {
-
echo '<error number="2" originaldescription="unable to locate folder">' ;
-
}
-
}
-
function DELETE_RECURSIVE_DIRS($dirname) { // recursive function to delete
-
// all subdirectories and contents:
-
-
while($file=
readdir($dir_handle)) {
-
if($file!="." && $file!="..") {
-
if(!
is_dir($dirname.
"/".
$file)) {
-
-
} else {
-
DELETE_RECURSIVE_DIRS($dirname."/".$file);
-
}
-
}
-
}
-
-
-
}
modify editor/filemanager/connectors/php/connector.php so that the command switch looks like this:
PHP:
-
switch ( $sCommand ) {
-
case 'GetFolders' :
-
GetFolders( $sResourceType, $sCurrentFolder ) ;
-
break ;
-
case 'GetFoldersAndFiles' :
-
GetFoldersAndFiles( $sResourceType, $sCurrentFolder ) ;
-
break ;
-
case 'CreateFolder' :
-
CreateFolder( $sResourceType, $sCurrentFolder ) ;
-
break ;
-
/******ADDED DELETE COMMANDS******/
-
case 'DeleteFile' :
-
DeleteFile( $sResourceType, $sCurrentFolder ) ;
-
break ;
-
case 'DeleteFolder' :
-
DeleteFolder( $sResourceType, $sCurrentFolder ) ;
-
break ;
-
}
modify editor/filemanager/connectors/php/config.php allowed commands:
PHP:
-
$Config['ConfigAllowedCommands'] =
array('QuickUpload',
'FileUpload',
'GetFolders',
'GetFoldersAndFiles',
'CreateFolder',
'DeleteFile',
'DeleteFolder') ;
You will also need to make sure that this connector is enabled in this file also but you knew that already didn't you?
PHP:
-
$Config['Enabled'] = true ;
modify editor/filemanager/browser/default/frmresourceslist.html.html so that the functions look like this:
PHP:
-
oListManager.GetFolderRowHtml = function( folderName, folderPath, folderUrl ) //added folderUrl
-
{
-
// Build the link to view the folder.
-
var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ;
-
-
return '<tr>' +
-
'<td width="16">' +
-
sLink +
-
'<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' +
-
'</td><td nowrap colspan="2"> ' +
-
sLink +
-
folderName +
-
'</a>' +
-
'</td><td align="right"><a href="#" onclick="DeleteFolder(\''+folderName+'\',\''+ folderUrl.replace( /'/g, '\\\'') + '\');return false;">DELETE</a></td></tr>' ;
-
}
-
-
oListManager.GetFileRowHtml =
function( fileName, fileUrl,
fileSize )
-
{
-
// Build the link to view the folder.
-
var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;
-
-
// Get the file icon.
-
var sIcon = oIcons.GetIcon( fileName ) ;
-
-
return '<tr>' +
-
'<td width="16">' +
-
sLink +
-
'<img src="'+fileUrl+'" border="0" style="border:1px solid black; margin:5px;" alt="" height="70" /></a>' +
-
'</td><td> ' +
-
sLink +
-
fileName +
-
'</a>' +
-
'</td><td align="right" nowrap> ' +
-
-
' KB' +
-
'</td><td align="right"><a href="#" onclick="DeleteFile(\''+fileName+'\',\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">DELETE</a></td></tr>' ;
-
}
-
-
function DeleteFile( fileName, fileUrl )
-
{
-
if (confirm('Are you sure you wish to delete ' + fileName + '?')) {
-
oConnector.SendCommand( 'DeleteFile', "FileUrl=" + escape( fileUrl ), Refresh ) ;
-
}
-
-
}
-
-
function DeleteFolder( folderName, folderPath )
-
{
-
if (confirm('Are you sure you wish to delete \'' + folderName + '\' and all files in it?')) {
-
oConnector.SendCommand( 'DeleteFolder', "FolderName=" + escape( folderPath + folderName ), Refresh ) ;
-
}
-
}
*NOTE* This will also show a thumbnail image - you can change the function to turn this off if you want *NOTE*
oh and also in the function modify this..
PHP:
-
oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ) ;
to be this...
PHP:
-
oHtml.Append( oListManager.GetFolderRowHtml( sFolderName, sCurrentFolderPath + sFolderName + "/", sCurrentFolderUrl ) ) ;
I think that is all.. if I missed anything let me know and I will update this quide.
Published at October 15, 2007
in Web.
I've come up with a solution that will refresh the entire editor (reloads the format drop down as well) without refreshing the whole page. I've been stumped on this for quite a while and needed to get it working so that I could use javascript to change an editor's CSS to match a template.
I added the following code to the fckeditor.html file..
CODE:
-
// mod to allow for custom editor area css
-
if(FCKURLParams['EditorAreaCSS'])
-
FCKConfig.EditorAreaCSS = FCKURLParams['EditorAreaCSS'];
and that allows me to pass in a parameter to the iframe that will force the editor to use the new CSS.
To refresh the editor using javascript I have used the following:
CODE:
-
var oEditor = FCKeditorAPI.GetInstance('content') ; //get editor object
-
document.getElementById("content").value = oEditor.GetHTML(); //save any changes
-
document.getElementById("content___Frame").src=document.getElementById("content___Frame").src.replace(/templates\/(.*)\/fck.css/,"templates/"+template+"/fck.css"); //refresh the iframe with new css
I also needed to change my fckeditor.class.php so that the src attribute of the iframe was something like this:
CODE:
-
/puppy/fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Puppy&EditorAreaCSS=/templates/mytemplate/fck.css
This week I managed to get mythtv working and so far I've been faily happy with it. Anne keeps asking me if this will be our permanent pvr and at this stage I think it will be. She also keeps asking why we can't have windows like everyone else but thats another story.
The following is a few hiccups I encountered along the way and I've included them here so that I can refer back to them in the future if I need to.
My biggest hurdle was that I was trying to use the ATI restricted drivers for my video card (9800 pro). I never did get them to work and I've ended up using the open source drivers. They seem to work fine and I've got no complaints at all.
On my 16:10 screen I had to add an extra flag to get mythvideo to play videos in correct aspect ratio.
mplayer -vo xv -fs -zoom -monitoraspect 16:10
I've been using the t8 icons from
http://techtoucian.net/regulars/channels/logos/t8/blue
which look great but I needed some extra for win and prime so I made up my own. If you would like a copy I have attached them here:




Just a quick blog to say that I have upgraded to the latest version of wordpress.
Oh.. and this is for all those people who are confused at my title.. A screensaver is not a wallpaper. They are different. I don't know how many times I need to tell people this!
Published at June 29, 2007
in Flash.
Today is the release day for a flash game I've been working on for the last few weeks at work. Its a flash game for Campbells Chunky Fuel up for footy competition. If your interested in haveing a play or checking it out have a look here: http://www.campbellschunky.com.au/ (click games)
Final cut pro studio 2 has arrived today and I'm very impressed.
So far.. it seems to have alot of new features and alot of the erks that I was having with it have been fixed. Here are some of the features I've noticed...
Motion 3D support is impressive
Compressor now exports mpeg program streams.
Sound Track Pro exports mp3... no more jumping into itunes just to convert a file
I will update this as I find out more...
Ok, so the wedding is over.. that means I don't have to do anymore wedding preperations.
CS3 has been released and We got the web studio for my work laptop. Here are my thoughts:
- Photoshop CS3 - Fantastic.. well worth it
- Illustrator CS3 - Dito
- Flash CS3 - Dito..
- Dreamweaver - Hardly worth it, Haven't noticed much speed difference or features at all.. This would be the biggest disapointment for me. Hopefully next version gets the new interface the others got.
- Fireworks - Installed it.. haven't used it.
- Contribute - Didn't bother.
- Flash video encoder - Better.. multipass encoding would of been nice.