donderdag 17 maart 2011

transparency cross browser support opacity or png

Ok, i still have to clean up this article since i'm writing it while finding out how it works.

My problem is getting the opacity on a div working for any platform.
Since MSIE isn't al that great in opacity, it's kinda tricky.

I found out opacity is kinda easy to use via css. it works in almost all browsers.

http://www.drunkenfist.com/304/2007/07/09/cross-browser-opacity-using-css-and-internet-explorer-custom-filters/

but without setting the width or height, it could conflict in some browsers (a div of 100% width inside a div of 200px width wont display properly)

http://www.west-wind.com/Weblog/posts/10213.aspx

I used tables around the div, and inside the div to solve this problem.

Now everything works in most browsers (opacity+stretchable divs (they stretch to the content dimensions, the width of an image inside the div, which will get the transparent overlay (div) containing text which isnt transparent (in a seperate div)

Normally setting opacity on a div, will make everything inside it transparent.
to avoid this, u can use background-color:rgba(180,80,80,0.8) which only aplies alpha on the div background, not the content.
Pretty need feature, but of course not supported by MSIE, also not MSIE8. terrible. It works in most current popular browsers, cross platform.
link

The only way i currently see now to solve this, is using transparent png for these browsers.

http://24ways.org/2007/supersleight-transparent-png-in-ie6

I will see how that works.
Or i use png by default. or i use png just for IE.
anyway, png would be best as only fix, but then again, not all (older) browsers support (transparent) png...
http://entropymine.com/jason/testbed/pngtrans/
argh.

check (2010 data):
http://serverfault.com/questions/34464/how-wide-spread-is-browser-support-of-png-graphics
http://www.libpng.org/pub/png/pngapbr.html

this: http://css-tricks.com/rgba-browser-support/

or you can always use a hammer...Please leave your comments..

donderdag 8 januari 2009

flash drawing applications actionscript

If you are trying to build a flash drawing application in actionscript, a tool where users can draw in swf, these links might come in handy. Myself im actually working on something where users can FILL shapes, just like in a traditional coloring book for kids.

Nevertheless i cannot find any usable actionscript for this.
All i can find and fix is filling using actionscript, predefining the coordinates in AS.
Since i am using jpgs ( or vectors) as a base image, it is not possible.
I have to put all lines in actionscript first, which is impossible to start with.

So i will fake it, creating clips for every shape, and changing its color trough actionscript.
Its a stupid workaround, timeconsuming, but it will do for this projects.

Here some more links on drawing in flash.
They are great, but they wont help you with the FILL problem..
Let me know if you find a solution for this!!! ( also, in CS4 i think it might be possible)


http://www.actionscripts.org/forums/showthread.php3?t=159637
http://www.actionscript.org/resources/articles/10/1/Creating-a-Dynamic-Drawing-application-in-Flash/Page1.html
http://www.kirupa.com/forum/showthread.php?t=40686
http://www.queeky.com/draw/php/
http://psykopath.deviantart.com/art/Proper-Flash-Drawing-App-52545349
http://forums.macrumors.com/
http://jessewarden.com/2004/10/draw-lines-with-undo.html
http://www.flashandmath.com/basic/mousedraw/index.html


or you can always use a hammer...
Please leave your comments.

.

check complete server path to file or folder

Sometimes you need to know the complete server/directory path to a certain folder or file.
Let's say you are using .htaccess you will need to put a link in the file containing the complete server path to this file.

To find out this path, you can use this simple php script.
Create a php file and copy paste this code.
Save the file on your server in the folder of which you want to know the server path.
Open the file in your browser; it will display the complete path to this file.

Good luck!

-----the code----

< ? php
echo dirname (__FILE__);
?>

-----end code----

ps, dont use spaces between "< ? php" , it's just that this blog didnt support printing it otherwise..


or you can always use a hammer...
Please leave your comments.

.

Mac OSX change screenshot format png to jpg or other

Was doing a project, needed to cut up pictures...
It would have been easy just taking new screenshots and replacing them. Only problem is that MacOSX saves a screenshot as png format, not jpg.

Now you dont have to resave them in an imageeditor, you can just change the preferences of MacOSX like this:
(thanks tice;)

---
In Mac OS X 10.4 and later, the default screenshot format can be changed, by opening Terminal (located at /Applications/Utilities/Terminal) and typing in:

defaults write com.apple.screencapture type image_format
killall SystemUIServer
Where image_format is one of jpg, tiff, pdf, png, bmp or pict (among others). If you omit the second line, you will need to log out and in again for the change to take effect.
----



or you can always use a hammer...
Please leave your comments.

.

dinsdag 13 mei 2008

flash plays mp3 files at wrong or double speed

I had a flash file loading an external mp3 file trough actionscript. This works perfectly in some flash players, but others might play the mp3 file at a wrong speed (double speed).
This problem never occured to me, but i have some friends experiencing this problem.

The reason for this problem is the encoding of the mp3 file.
Flash only supports mp3 files encoded at a multiple rate of 11.025, so you should only use mp3 files encoded at 11, 22, 44... bitrate, where 44 would cause the least of problems. Other bitrates will (in some players) play the sound at a wrong or double speed.

Strange Adobe never fixed this, since this problem never occured with older flash players.
Anyhow, this encoding thing should do the trick, and your sound will play perfectly.


here some testing results i found at drupal.org
there is also a patch offered so the flash can only play files at the correct speed.
-----
TESTFILES LOCATED AT: http://playlist-demo.drupalart.org

Constant Bitrate, 192 Kbps, 44100 Hz, Stereo [OK]

Constant Bitrate, 128 Kbps, 44100 Hz, Stereo [OK]

Constant Bitrate, 112 Kbps, 44100 Hz, Stereo [ stuttering start/finish]

Constant Bitrate, 96 Kbps, 44100 Hz, Stereo [ stuttering start]

Constant Bitrate, 64 Kbps, 44100 Hz, Mono [ stuttering start/finish]

Constant Bitrate, 128 Kbps, 32000 Hz, Stereo [plays at faster speed, stuttering start]

Constant Bitrate, 96 Kbps, 32000 Hz, Stereo [plays at faster speed, stuttering start]

Constant Bitrate, 96 Kbps, 24000 Hz, Stereo [plays at even faster speed, stuttering start]

Constant Bitrate, 96 Kbps, 22050 Hz, Stereo [stuttering start]

Constant Bitrate, 64 Kbps, 22050 Hz, Stereo [OK]

Constant Bitrate, 32 Kbps, 11025 Hz, Stereo [stuttering start/finish]

Variable Bitrate, 125-180 Kbps VBR [OK]
------
thanks to zirafa for these testing results
------

or you can always use a hammer...
Please leave your comments.

.

woensdag 12 maart 2008

Virus and antivirus on MacOSX

Is there a need for AntiVirus software on the Mac?

It is commonly said that there are no virusses affecting the Mac, This is true in a way, but virusses for MacOsx exist.
Most of them are old virusses, and won't do any harm to your system, but nevertheless new virusses are popping up. Although still innocent, it could become a problem in the future.
Apparently more and more hackers try to prove some instability in the MacOS environment.

Today, a Mac affected by (or malfunctioning due to) a virus is still very rare, but i tried the famous ClamXav anyway.
ClamXav is een AV programm that uses the ClamAv engine to search your computer for virusses. ClamXav has a GUI wich makes it easy to use.
This particular software one of the most famous available for the mac, and its free.
It is known to be a fast and accurate piece of software to protect your computer from virusses.

I have installed ClamXav and did a systemscan on my Mac. For being a fast scanner, it took me more than 2 hours to scan my computer, and it slowed down the entire system, but no mac virusses were found, ofcourse, wich is still a good feeling.
(The scan did find a trojan in an old deleted email)


---my scan results ---


Started scanning
Please note, large files will take a long time to scan.

/Users/******/Library/Caches/Java/cache/javapi/v1.0/jar/count.jar-21edef6a-635fcef5.zip: Java.Classloader FOUND
/Users/******/Library/Caches/Java/cache/javapi/v1.0/jar/count.jar-2cf0bf70-5123d8f1.zip: Java.Classloader FOUND
/Users/******/Library/Mail/POP-********/INBOX.mbox/Messages/11812.emlx: Trojan.Dropper-3172 FOUND
******
The above file looks like it may be part of an email mailbox, please think carefully about what to do with this file. If it has been quarantined, you may end up losing some email. I suggest you leave this file where it is (or move it back if it's been quarantined) and delete suspicious messages from within your email client.
******
----------- SCAN SUMMARY -----------
Known viruses: 228651
Engine version: 0.92
Scanned directories: 6287
Scanned files: 65202
Infected files: 3
Data scanned: 63272.87 MB
Time: 8248.216 sec (137 m 28 s)

ClamXav v1.1.0 - ClamAV 0.92/6218/Wed Mar 12 20:07:21 2008 - ClamXav

One or more infected files were found, but were left where they are. You can either deal with them yourself, or scan again with the preferences set to move them into a different folder.


-------------

I deleted the 3 corrupted files manually, so my system 'should' be clean now..
Hopefully, virusses will stay away from the mac forever, but this would be a fantasie.
And if you haven't already done so, it is very advisable to download and install the latest security update for MacOsx, you can find it on the apple website

anyone has any info on botnets using macs as a zombie?


some related stuff:
forum topic virus on mac - dutch
info about clamAv and clamXav on oreillysite
download clamxav





or you can always use a hammer...
Please leave your comments.

.

woensdag 20 februari 2008

Convert wmv to avi mp4 mov ipod etc for mac

I ve been looking for some freeware or shareware programs for Mac to convert wmv files into something usable on mac without using flip4mac.

I ran into different kinds of software and the following came out ready to be used:

ipod video convertor
it works well and fast, a clkean and fast installating, but the trial version only alows to do 5 minute clips or less, so you will have to register for bigger files. One thing that bothered me: it drops a lot of frames on older videofiles. the video went almost double as fast as the audio, and i couldnt get it fixed in the settings.
http://www.dvd-to-ipod-video-converter-for-mac.com-http.com/how-to-convert-wmv-to-ipod-for-mac.html

i stopped looking for another program, soon more info..
let me know if you find any good ones!

or you can always use a hammer...
Please leave your comments.

.