AS3, Value Object

Value Objects, Sans Constructor

10.20.09 | Permalink | Comment?

Value Objects generally hold a related set of data and may or may not have implementing methods. For example, a value object could be used to store a record returned from an SQL query so that this record could be passed around an application, typed as a particular datatype, let’s say, Product, allowing the [...]

Tags: , , ,

AS3

Checking for existence of data in Objects via properties and in XML via nodes and attributes

06.14.09 | Permalink | Comment?

Checking for existence of data can be handy; I often find myself needing to do so to avoid runtime errors. Here’s a quick look at the actionscript 3 syntax for a few of the more frequently needed checks:
XML:
1. checking for existence of attributes:
EXAMPLE: Where d is an XML node, we’re checking to see if [...]

Tags:

AS3

AS3: Applying Drag to Display Object with Nested Components

05.26.09 | Permalink | Comment?

I have a display object, and I want to allow users to drag this display object about the screen – no big deal.
Complicating the issue is that, nested in the display object, I have components, and I need their mouse enabled properties to stay true so users can select the items in the components and [...]

MySQL

MySQL: Creating Foreign Keys

05.24.09 | Permalink | Comment?

When creating foreign key constraints in MySQL:
both tables must be InnoDB tables
The size and sign of integer types must be the same
InnoDB requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. In the referencing table, there must be an index where the [...]

Import Data, MySQL

MySQL: Import Data Into MySQL Table From External File

05.24.09 | Permalink | Comment?

Prepare a comma-delimited text file, this can usually be done fairly quickly with most text editors, something in the format of:
1, ‘Product Name’, ‘This is the product description, blah blah blah’
2, ‘2nd Product Name’, ‘2nd product description, blah blah blah’

– NOTE: The intentional carriage return after the last record in the .txt file

Make certain that, [...]

AS3, Errors

AS3 Get calling Object or Function…

05.21.09 | Permalink | Comment?

Weird stuff going on? Need to find out who’s the culprit? Use:
trace(new Error().getStackTrace());
To throw up a stack trace to see who’s involved…it will be like turning on the lights during a slow song at a high-school dance…you may want to shield your eyes!

Php

PHP Notice: Trying to get property of non-object in…

05.15.09 | Permalink | Comment?

This notice may be due to an error thrown while connecting to or querying a mySql database. Start by checking your connection settings, remembering that certain characters cannot be used in connection passwords. If that doesn’t solve the issue, check your SQL statement, etc.

AS3, Datatype, Interface

AS3 Interfaces

05.06.09 | Permalink | Comment?

Interfaces denote the signature of a datatype, excluding any implementation, and can therefore be considered a super-type.
Classes implement an Interface by using the “implements” keyword in their class definition, like so:
package ca.codetoad.beers
{  
    public class Lager implements IBrewable
    {
        //…code
    }
}
The implementing class must then implement each method [...]

AS3, Errors, Zendamf

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion

04.21.09 | Permalink | Comment?

Right, it’s driving you nuts, I know…the dreaded Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion. This little post will simply discuss a few possible reasons you may be receiving this error, and how to circumvent the problem…I’ll add to this post as I screw things up myself and find solutions…
This post is about dealing with [...]

Tags: , , ,

AS3, Datatype, Date()

Quick reformatting of a String containing the value of a date

04.19.09 | Permalink | Comment?

Part of the series:
Working with Dates in AS3: A 7953-part series
Today…the quick and dirty:
You’re working on an AS3 project, you’re receiving a date formatted in MySQL, but you don’t have control over how this date is formatted upon storage into, or outputted from, a database…the date arrives via XML formatted like so:
2011-02-24
You’re bummed! You [...]

« Previous Entries