//

Delete enhanced fill problem

Thats it! I am tired of getting the "Enhanced fill not supported in current player version" problem when I import fills from AI/FH/FW and you need to export to V7 or under, so once and for all I am putting a stop to it.

Here are 3 simple steps to get rid of this problem (of course this will be applied after you have imported a vector image with gradients to your stage).

1. Change your export settings to V8.
2. Pull the "Color Mixer" Palette.
3. Under Overflow select "Extend", take off the check mark from Linear RGB

That is it now you can change your export settings back to V7 or V6 or under and you should be fine. That is all you have to do and all your problems should go away, no more warnings no more asking you to fix your gradients.

Ah! but sometimes the gradient or Flash will be stubborn and still make fuss about the Fills. Well these are some things you can do..

If under the "Color Mixer" Palette your Overflow was selected as "Extend" and the Linear RGB was unselected, well just select Overflow again and check and uncheck the Linear RGB option. That will fix the stubbornness 99.9999999% of the time.

If you still have troubles after you have completed the steps above feel free to ask.

//

Set a footer on your Flash Movie

ActionScript:
    stageListener = new Object();
    stageListener.onResize = function() {
    // enter what you want to do on resize, for example:
    contentHolder_mc._y = Stage.height - contentHolder_mc._height;
    contentHolder_mc._width = Stage.width;
    }
    Stage.addListener(stageListener);
    stageListener.onResize();   
//

Short hand for If Statement

a = b ? true : false;

a == b ? (true1, true2) : false

//

Exporting from Illustrator to SWF “bug”

If you are exporting any artwork from Illustrator to SWF and when working in Flash and player 7(or less) you might get the following error "Enhanced stroke is not supported in this player".

One way to fix this issue is by setting "Perserve Editability Where Possible" under the Method section.
Now this might not work with all the artwork where you want to be able to do heavy edits within flash but its worth a shoot.

//

Error in supported CSS properties in Flash

So actually there is not an error in the way the CSS properties are handled within Flash, if you area always in the run trying to get things done you will notice that the first column in the Flash Help file for the CSS properties has (for example) text-align. You might right away try to use the properti as such but if you look closer there is a column next to the CSS properties called ActionScript property and in there you have the defenition of how the CSS property must be handled. In the case of text-align it must be textAlign.

If it is well explained in the Docs then why did I name this Post "Error in supported CSS properties in Flash"? Good question, I was about to report this as an error until I realized it was my mistake and it was not the Docs, I just scan throu the document without paying too close attention.

With that said I believe it could be a good idea to have the compiler check for small items like that, I mean really how hard would it be to check for "text-align" in your code and prompt a warning like "Hey! you are using text-align" in your code, did you mean to use textAlign?.

heh just an idea :)

//

Using Switch and Case

Following the samples from the Flash Docs you will have the following:

ActionScript:
    switch (variable) {
       case 0:
       trace("Option0");
       break;
       case 1:
       trace("Option1");
       break;
       case 2:
       trace("Option2");
       break;
    }

But if you are about to test against a string variable instead of a number variable your first instict (or at least i guess it would be your first instict) would be just to place the string inside the case statement

ActionScript:
    case thevariable;

Once you run your code this is not going to work, granted the variable you are testing might be the exact variable you are expecting but in reallity flash won't know it is a string until you put it in quote marks.

ActionScript:
    case "thevariable";

I hope this little tip helps out some of you...

//

ActionScript Email Validation

Sooner or later you will face with the small quest of validating an email address for your flash application. The following script is a basic script and should not be used for websites that relay heavily on the email address is being requested (shopping carts, credit card transactions and so forth)

ActionScript:
    function isValidEmail(e) {
    if (e.indexOf("@") != -1 && ( e.indexOf(".") > e.indexOf("@") ) ){
    trace("success");
    }else{
    trace("error");
    }
    }

    //Test
    isValidEmail("test@test.com");

//

Never Understimate the power of MovieClips used as Graphics

When the time comes when you have to develop the same set of animations for different sets and different sizes don’t forget to use your MovieClips as Graphics, this is a great way to save work for everyone.

Not only you will be able to deliver on time (and if you are lucky under schedule) but also you will be able to produce work faster and at the same time cut prices for the production. So in the end this is a Win-Win situation

//

The TRUTH about PHP/mySQL security Part II

..continued from The TRUTH about PHP/mySQL security Part I

So here we are on "The TRUTH about PHP/mySQL security Part deux", So after reading lots of websites/blogs and reviewing nearly 100 OS PHP/mySQL scripts I have found that everyone has a similar structure

Main Page
  |- imgs
     |-someimage.jpg
     |-someimage.jpg
  |- inc
     |- dbconnection.php
     |- extra_file.php
     |- extra_file.php
     |- extra_file.php

What we want to look for is the dbconnection.php file. So lets take a look at a simple dbconnection.php file

PHP:
    < ?
    include "../config.php";
     
    function db_connect()
    {
       $result = @mysql_pconnect($server, $db_user, $db_pass) or die ("Database CONNECT Error (db_fns line 7)"); 
       if (!$result)
          return false;
       if (!@mysql_select_db($database))
          return false;

       return $result;
    }

    ?>

But now we see there is an include config.php, lets take a look into that file

PHP:
    < ?
    $domain      = "www.yourdomain.com"; // Your domain name (include www. if used BUT NOT http://)
    $server            = "localhost"; // Your MySQL server address (usually 'localhost')
    $db_user           = "username"; // Your MySQL database username
    $db_pass           = "password"; // Your MySQL database password
    $database          = "database"; // Your MySQL database name
    $currency   = "UK Pounds"; // The currency that your affiliates will be paid in
    $emailinfo                = "test@email.com"; // Your email address
    $yoursitename   = "Your Site Name"; // Your sites name
    ?>

Is all this information sensitive? Of course it is! imagine some one getting a hold of your $db_user or $db_pass variable, they could easily create scripts that will log into your DB and either edit the information or destroy it. But I'm not going to go into detail about that, what I am after is to learn how secure it is to leave your php scripts out in the open and from what I have learned so far it is pretty safe do that, but I want to continue to search for what other kind of security is offered by PHP.

...to be continued

//

The TRUTH about PHP/mySQL security Part I

So I finished a small application that I am using only on my computer to avoid any problems on the net in regards to security (name it hackers/crackers/enthusiast/whichever).

Since there is no easy way to ask a question like What is the best way to create a secure applicationI decided to send the question out there and ask to what everyone thinks or believes is a secure way to create their applications.

I have been working with PHP/mySQL as user not much as developer for the past years but now trying to learn more about the developer side, I have hit a wall once I have faced Security.

For a while I was certain that putting my sql connection in a PHP file it was ok, this believe was even stronger while using different applications out there that place their connections logarithms inside folders named as simple as connections, and if we want to examine this theory further if you create a Database Connection in Dreamweaver the application itself will create a folder titled Connections and inside that folder it will write the scripts necessary to connect to your DataBase.

With all this in mind I ran into a basic tutorial that highlighted the importance of having your connections secure and one recommendation was to place your connections script (or PHP file) under a password protected directory. This would be an overkill IMHO and not only that but securing a password with another password?

To Be Continued....