<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iD Tech Camps &#187; Objects</title>
	<atom:link href="http://www.internaldrive.com/tag/objects/feed/" rel="self" type="application/rss+xml" >
	<link>http://www.internaldrive.com</link>
	<description>Summer Computer Camps for Kids, Teens &#38; Youth</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:58:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Integrating Flickr with vBulletin</title>
		<link>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/</link>
		<comments>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:40:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[changes]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr API]]></category>
		<category><![CDATA[Manager]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Objects]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpFlickr]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22446</guid>
		<description><![CDATA[Our support forums here at iD Tech run on the popular internet forum software, vBulletin. Each year we constantly revamp the system with new upgrades, a new design, and new code plugins to make the process more specific to our business model and more accessible to our staff. In addition, we also have a public [...]]]></description>
			<content:encoded><![CDATA[<p>Our support forums here at iD Tech run on the popular internet forum software, <a title="vBulletin" href="http://www.vbulletin.com" target="_blank">vBulletin</a>. Each year we constantly revamp the system with new upgrades, a new design, and new code plugins to make the process more specific to our business model and more accessible to our staff.</p>
<p>In addition, we also have a public Flickr stream. I wanted to pull these two elements together so that we could bring examples of our Flickr photos to our own support system. Here&#8217;s how I integrated them.</p>
<ol style="padding-left: 30px;">
<li>Download the phpFlickr API from here: http://www.phpflickr.com/</li>
<li>Unzip the files to your vBulletin <strong>/includes/</strong> folder.</li>
<li>If you want, you can rename the files to match the vBulletin naming convention (i.e. phpflickr.php -&gt; functions_phpflickr.php).</li>
<li><strong>Optional: </strong>Create a new vBulletin product. From the admin side, choose <strong>Manage Products</strong> from the <strong>Plugins &amp; Products </strong>menu. Then select <strong>Add/Import</strong> product. Fill in the information you need for a new product and hit save.</li>
<li> Add a new vBulletin plugin. From the <strong>Plugins &amp; Products </strong>admin menu, select <strong>Add New Plugin</strong>. Select the product you created in <strong>Step 4</strong>, or <strong>vBulletin</strong> otherwise. For hook location, you&#8217;ll need to select where you want the Flickr photos displayed. I&#8217;m placing them on our vBulletin homepage, so I select <strong>forumhome_start </strong>for my hook. Enter a title (such as <strong>Flickr Integration</strong>), leave the exectution order alone, and use the PHP code shown below.</li>
<li>From the <strong>Styles &amp; Templates </strong>menu, select <strong>Style Manager</strong>. Pick your style and choose <strong>Edit Templates</strong>. Find <strong>FORUMHOME </strong>(or whichever style is applicable to the hook location you chose) and double-click on it.</li>
<li> Find the location in the template where you want your photos displayed and enter <strong>$flickrbox</strong>, the name of the variable we are pulling from our PHP plugin.</li>
</ol>
<p>Now let&#8217;s take a look at the code we&#8217;re placing in our plugin.</p>
<pre style="padding: 30px 0px 30px 30px;">require_once("includes/phpFlickr.php");

// Create new phpFlickr object
$f = new phpFlickr("yourapikey");
$f-&gt;enableCache("db","mysql://user:password@server/database");

$limit = 11;

// Find the NSID of the username inputted via the form
$person = $f-&gt;people_findByUsername('iDTechCamp');

// Get the friendly URL of the user's photos
$photos_url = $f-&gt;urls_getUserPhotos($person['id']);

// Get the user's first X($limit) public photos
$photos = $f-&gt;people_getPublicPhotos($person['id'], NULL, NULL, $limit);
$flickrbox = "&lt;table class='flickrbox'&gt;&lt;tr&gt;";

// Loop through the photos and output the html
foreach ((array)$photos['photos']['photo'] as $photo) {
    $flickrbox .= "&lt;td&gt;&lt;a class='flickrimg' href=$photos_url$photo[id]&gt;";
    $flickrbox .= "&lt;img border='0' alt='$photo[title]' "
               ."src=" . $f-&gt;buildPhotoURL($photo, "Square") . "&gt;";
    $flickrbox .= "&lt;/a&gt;&lt;/td&gt;";
}

$flickrbox .= "&lt;/tr&gt;&lt;/table&gt;";</pre>
<p>First, we <strong>require_once</strong> the phpflickr php api library. Alter this line if you choose to name your library differently. Next, we create a new phpFlickr object, <strong>$f</strong>, and supply our Flickr API key. Change this line to reflect your unique API key. Next, we optionally enable the cache available with this library by supplying our mySQL database details. If you don&#8217;t have your details, don&#8217;t worry, this step isn&#8217;t required.</p>
<p>We then set a limit for how many photos we want. I&#8217;ve chosen 11. We use <strong>people_findByUsername</strong> to get photos for our particular user, in this case, the company username <strong>iDTechCamp</strong>. The resulting statements will pull <strong>$limit</strong> number of photos from the public profile of our user. Lastly, we need to construct a variable that holds the output as HTML. Our variable here is <strong>$flickrbox</strong> and as you can see I&#8217;m generating a table with CSS class style named <strong>flickrbox</strong>. Each image in the table is table cell and contains a link to that particular image. We also set the image title to the photo title pulled from <strong>Flickr</strong>.</p>
<p>You can easily alter the PHP code here to produce tableless HTML or any other structure you like. I hope these instructions help you to integrate your board and Flickr! Email me or comment with any questions you might have.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Properly Referencing Your Main Class in Flash Actionscript</title>
		<link>http://www.internaldrive.com/2008/12/19/referencing-main-class-in-flash-actionscript/</link>
		<comments>http://www.internaldrive.com/2008/12/19/referencing-main-class-in-flash-actionscript/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 00:25:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Objects]]></category>
		<category><![CDATA[Stage]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=20316</guid>
		<description><![CDATA[For those of you moving from Actionscript 2 to 3 (with a heavier focus on proper object-oriented principles), you may find that accessing your Main class and Stage isn&#8217;t as straight-forward. In this post we&#8217;ll highlight organizing your classes to properly reference your main class. First, let&#8217;s take a look at our Main class: package [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you moving from Actionscript 2 to 3 (with a heavier focus on proper object-oriented principles), you may find that accessing your Main class and Stage isn&#8217;t as straight-forward. In this post we&#8217;ll highlight organizing your classes to properly reference your main class. First, let&#8217;s take a look at our Main class:</p>
<pre>package {</pre>
<pre>    import flash.display.Stage;</pre>
<pre>    import flash.display.MovieClip;</pre>
<pre>    public class Main extends MovieClip {</pre>
<pre>        private static var _instance:Main = null;</pre>
<pre>        public function Main() {</pre>
<pre>            _instance = this;</pre>
<pre>        }</pre>
<pre>        public static function getInstance():Main { return _instance; }</pre>
<pre>        public static function getStage():Stage { return getInstance().stage; }</pre>
<pre>    }</pre>
<pre>}</pre>
<p>First we define a static variable,<strong> _instance</strong>, to hold a static reference to Main. We are assuming throughout this that we will use Main statically. In other words, there will only be a single instance of our Main class. Next, in our constructor, we use the line <strong>_instance = this;</strong> to set our static version of Main to the one that is created when the constructor is called.</p>
<p>We will use two methods to get access to Main and the main stage. First, <strong>getInstace()</strong> is a static function that always returns a copy of <strong>_instance</strong>. If you want the stage instead, use <strong>getStage()</strong>. All <strong>getStage() </strong>does differently from <strong>getInstance()</strong> is return the <strong>stage</strong> property of <strong>_instance</strong> rather than the object itself. Using this format simplifies your code in other classes.</p>
<p>Now let&#8217;s say you want to use these functions in other classes to add something to the stage. Let&#8217;s pretend we have a Tree class that needs to add itself to the main stage when it is created. You could use this code:</p>
<pre>package {
    import flash.display.Sprite;&lt;/code&gt;

    public class Tree extends Sprite {
        Main.getStage().addChild(this);

        x = Math.random() * Main.getStage().stageWidth;
        y = Math.random() * Main.getStage().stageWidth;
    }
}</pre>
<p>You can see that we can easily get properties of the stage (<strong>stageWidth</strong> and <strong>stageHeight</strong>) simply by statically referencing Main. Note that we could have used the following lines instead:<br >
<code><br >
x = Math.random() * Main.getInstance().stage.stageWidth;<br >
y = Math.random() * Main.getInstance().stage.stageWidth;<br >
</code><br >
It really just depends on which example you find more elegant. One additional benefit of using the techniques described here is that you can use the <strong>getInstance()</strong> to determine if Main has loaded. Simply do:<br >
<code><br >
if (Main.getInstance() != null) { /* some function */ }<br >
</code><br >
Hope that gives you an easy framework for accessing your stage and Main class in AS3!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2008/12/19/referencing-main-class-in-flash-actionscript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

