<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Starling Forum &#187; Topic: addChild works in classes but i dont see them on screen.</title>
		<link>http://forum.starling-framework.org/topic/addchild-works-in-classes-but-i-dont-see-them-on-screen</link>
		<description>The Starling Framework Community</description>
		<language>en-US</language>
		<pubDate>Sat, 18 May 2013 12:10:24 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forum.starling-framework.org/search.php</link>
		</textInput>
		<atom:link href="http://forum.starling-framework.org/rss/topic/addchild-works-in-classes-but-i-dont-see-them-on-screen" rel="self" type="application/rss+xml" />

		<item>
			<title>MacShrike on "addChild works in classes but i dont see them on screen."</title>
			<link>http://forum.starling-framework.org/topic/addchild-works-in-classes-but-i-dont-see-them-on-screen#post-4931</link>
			<pubDate>Tue, 17 Apr 2012 02:00:09 +0000</pubDate>
			<dc:creator>MacShrike</dc:creator>
			<guid isPermaLink="false">4931@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Sir daniel,&#60;/p&#62;
&#60;p&#62;captcha failed again so im writing this twice so ill be to the point.&#60;/p&#62;
&#60;p&#62;I dont want to burden you with debugging my bs, especially since im new to OOP and you might vomit because of my source.(I will if needed but i dont see an attach/upload button here)&#60;/p&#62;
&#60;p&#62;So In short:&#60;/p&#62;
&#60;p&#62;basic structure is:&#60;br /&#62;
- Starling stage init calls flockie class thru new Starling(flockie,stage)&#60;br /&#62;
- class flockie instatiates a class flock(nrofbirds) // nr of birds beeing an int&#60;br /&#62;
- class flock constructor loops nrofbirds time calling new bird() then pushes it into Vector.&#38;lt;bird&#38;gt; a.k.a. the birdvector.&#60;br /&#62;
&#60;strong&#62;and here it comes...&#60;/strong&#62;&#60;br /&#62;
-class bird constructor creates bitmap for bird and adds it to stage with addChild(image).&#60;br /&#62;
but it doesnt appear on stage.&#60;br /&#62;
&#60;strong&#62;...however...&#60;/strong&#62;&#60;br /&#62;
if I, in the main class flockie, after constructing the new flock(nrofobirds), loop nrofbirtds time thru the vector with addChild(flock.birdvector[idx].image);&#60;br /&#62;
They do appear on stage.&#60;/p&#62;
&#60;p&#62;Why is this?&#60;/p&#62;
&#60;p&#62;Highest regards,&#60;/p&#62;
&#60;p&#62;Mac
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Daniel on "addChild works in classes but i dont see them on screen."</title>
			<link>http://forum.starling-framework.org/topic/addchild-works-in-classes-but-i-dont-see-them-on-screen#post-4844</link>
			<pubDate>Fri, 13 Apr 2012 18:32:22 +0000</pubDate>
			<dc:creator>Daniel</dc:creator>
			<guid isPermaLink="false">4844@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Sorry Mac, I have problems understanding the nature of your problem. Have you looked and compiled the demo app that comes with Starling? A good starting point would be to modify it and play around with that. Here, all setup-stuff is already prepared.&#60;/p&#62;
&#60;p&#62;If that does not help, please post some real source code -- then it's easier to find out what is going wrong.&#60;/p&#62;
&#60;p&#62;Good luck! =)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MacShrike on "addChild works in classes but i dont see them on screen."</title>
			<link>http://forum.starling-framework.org/topic/addchild-works-in-classes-but-i-dont-see-them-on-screen#post-4789</link>
			<pubDate>Fri, 13 Apr 2012 05:23:35 +0000</pubDate>
			<dc:creator>MacShrike</dc:creator>
			<guid isPermaLink="false">4789@http://forum.starling-framework.org/</guid>
			<description>&#60;p&#62;Ls,&#60;/p&#62;
&#60;p&#62;a:To get myself aquinted with this speed monster called starling I wrote a small flocking routine that basically does:&#60;br /&#62;
new Startling(main, stage)&#60;br /&#62;
main:&#60;br /&#62;
init&#60;br /&#62;
new flock(nrbirds)&#60;br /&#62;
flock:&#60;br /&#62;
init flock&#60;br /&#62;
for (nbirds) -&#38;gt; new(bird)&#60;br /&#62;
bird:&#60;br /&#62;
init bird / birdimage&#60;br /&#62;
addchild(birdimage)&#60;/p&#62;
&#60;p&#62;They add, but dont show on stage. I tried passing the stage thru the constructors to bird.. Flash doesnt like that.&#60;br /&#62;
Tried making a Public Stage var.  Doesnt work.&#60;/p&#62;
&#60;p&#62;b: all subclasses after main are using the starling.sprite as superclass.&#60;/p&#62;
&#60;p&#62;So i did:&#60;br /&#62;
new Startling(main, stage)&#60;br /&#62;
main:&#60;br /&#62;
init&#60;br /&#62;
new flock(nrbirds)&#60;br /&#62;
for (nbirds)&#60;br /&#62;
      addChild(flock.coantains[nbird].birdimage)&#60;/p&#62;
&#60;p&#62;flock:&#60;br /&#62;
init flock&#60;br /&#62;
for (nbirds) -&#38;gt; new(bird)&#60;br /&#62;
bird:&#60;br /&#62;
init bird / birdimage&#60;br /&#62;
push bird into flock.contains(bird)&#60;/p&#62;
&#60;p&#62;now i see em onstage.&#60;/p&#62;
&#60;p&#62;Q: can I/how do I/ access the stage in sub classes to use addChild?&#60;br /&#62;
Q: what am i doing wrong?&#60;br /&#62;
Q: how the H did you get that to run so fast =)&#60;/p&#62;
&#60;p&#62;Highest regards,&#60;/p&#62;
&#60;p&#62;Mac
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
