Deprecated: Assigning the return value of new by reference is deprecated in /var/www/omflash.dk/public_html/wp-includes/cache.php on line 33

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/omflash.dk/public_html/wp-content/plugins/sem-subscribe-me2/sem-subscribe-me.php on line 511

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_query_vars() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_where() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_join() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_tag_templates() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1329
Globale variabler i ActionScript 3 - omFlash();
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_add_ajax_javascript() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1329

Globale variabler i ActionScript 3


Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_the_content_filter() should not be called statically in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 1252

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 638

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 638

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 639

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 639

Strict Standards: Non-static method UltimateTagWarriorActions::replaceTagWithLink() should not be called statically in /var/www/omflash.dk/public_html/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 643

Man kan diskutere hvorvidt globale variabler på store projekter i det hele taget er en god ide, da de hurtigt kan blive svære at holde styr på, men man kommer heller ikke uden om, at de i en del situationer giver mulighed for at spare tid ved at springe over hvor gærdet er lavest - og det gør vi allesammen jo indimellem.

I ActionScript 2 var det nemt at være doven, men kunne bare bruge _global, men i AS3 er der ikke noget tilsvarende objekt, men efter selv at have haft behovet for nyligt fandt jeg en klasse der fuldt ud erstatter _global, så næste gang du er i humør til at være doven, så kan du jo overveje at smutte herhen og læse mere om den:
AS3 Global Object



Tags: ,
Del:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg

    Relaterede artikler:
    Strict Standards: Only variables should be assigned by reference in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 615

    Strict Standards: Only variables should be assigned by reference in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 615

    Strict Standards: Only variables should be assigned by reference in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 615

    Strict Standards: Only variables should be assigned by reference in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 615

    Strict Standards: Only variables should be assigned by reference in /var/www/omflash.dk/public_html/wp-includes/functions.php on line 615
  • Square colors - auto-genereret kunst
  • Fredrik Clement V2
  • AntiAliasType.ADVANCED + Filter = Trouble
  • Flickr Julehjertefletter v. 2
  • Flash Player 10.2 og StageVideo

4 kommentarer

  1. Paulius Uza siger: (31. juli 2010 kl. 14:21 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    Thanks for the mention ;) Cheers

  2. Christian Schlosrich siger: (3. august 2010 kl. 13:39 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    Jeg er absolut ikke tilhænger af denne approach. Har du brug for at gemme data som skal være tilgængelig for hele applikationen, så lav en singleton collection klasse som tilgås statisk.

    Denne collection klasse skal styres vha. et Dictionary object som indeholder en custom datatype som fx. CollectionObject og kan fx. tilgås sådan her:

    var minData : CollectionObject;
    minData = Collection.getObjectByName(”min refererence”);

    trace(minData.minVariabel);

  3. Mads Buch Stage siger: (5. august 2010 kl. 17:22 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    Tak for kommentaren!

    Som jeg skriver, eller forsøger at skrive, flere gange, så mener jeg heller ikke at brugen af global er good practice, men at vi allesammen springer over hvor gærdet er lavest engang imellem, særligt på mindre projekter.

    Du skal i øvrigt være meget velkommen til at lave et godt eksempel på din blog med den metode du nævner, så linker jeg meget gerne til den :-)

  4. mat siger: (5. august 2010 kl. 20:14 )

    Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/omflash.dk/public_html/wp-includes/functions-formatting.php on line 83

    @Christian

    “Global” er en singleton, og han bruger en hashmap implementation, der er en forlængelse af Dictionary. Det eneste han ikke bruger er typed entries i hans collection?

Skriv en kommentar