Posts Tagged AS3

Love!

This tutorial on creating a scrolling movieclip saved my sanity today:
http://tutorials.flashmymind.com/2009/02/movieclip-scroller/

I tried to log in to comment and thank the author, but it wouldn’t take my info, so, if you track back to this, THANK YOU!

Comments off

Scrollable movieclip?

As I suspected, once that problem was solved, a new one would of course pop up almost immediately. This time I’m trying to make my newly populated movieclip scrollable. It’s populated with 30 movieclips, not textfields, so I can’t use .scrollV. And I need to put touchevents on the controls, so I can’t use a component.

Any ideas out there?

ETA:
============

Found a tutorial that might help–yay!
http://tutorials.flashmymind.com/2009/02/movieclip-scroller/

Comments off

Movieclip pile-up

ETA: Oops, some of my code got eaten up. Sorry about that! The for statement has been corrected.
================

WHY, in the below function snippet, would adding x,y coordinates to the mcOrg movieclip cause the collection of movieclips to dogpile on top of each other? W.T.F.??

var mcOrg:TouchMovieClip = new TouchMovieClip();
var mcOrgContainer:TouchMovieClip = new TouchMovieClip();

function xmlLoaded(e:Event) {
xmlORG=new XML(ulXML.data);
var numMuseums:Number=xmlORG.museum.length();

for (var i:int=0; i<numMuseums; i++) {
var genText:TextField = new TextField();
var genFormat:TextFormat = new TextFormat();
genFormat.color = 0x000000;
genFormat.size = 12;
genFormat.font = "Arial";
genText.embedFonts = true;
genText.type = "dynamic";
genText.x = 10;
//genText.y = 35*(i+1);
genText.y = 10;
genText.background = false;
genText.backgroundColor = 0xffffff;
genText.width = 280;
genText.height = 20;
genText.multiline = true;
genText.wordWrap = true;
genText.antiAliasType = "advanced";
genText.autoSize = TextFieldAutoSize.NONE;
genText.defaultTextFormat = genFormat;
genText.htmlText=xmlORG.museum[i].iwindow[0].name.children();
//trace(genText.htmlText);
genText.setTextFormat(genFormat);
mcOrg.addChild(genText);
mcOrg.x = -10;
mcOrg.height=30;
mcOrg.y =mcOrg.height * i;
mcOrg.addEventListener(TouchEvent.TOUCH_DOWN, traceContent);
mcOrgContainer.addChild(mcOrg);

}//close for statement
orgContainer.addChild(mcOrgContainer);

Comments (4)

Kill the drag

Things have been moving right along on our little project. We’re in the final inning, though, as it ‘goes live’ on Monday, and we’re still developing. (Review process? We don’t need no stinking review process!)

Our current ‘unsolveable’ project has been making a touchsprite NOT be draggable. We need it touchable, or in some cases we need its children to be touchable, but when it is (touchable, that is), it drags, and we can’t turn that property off. (Yes, we’ve tried stopTouchDrag(), and no, it doesn’t work.)

This means that our pretty navigation orb opens a pretty nav window that, instead of sticking with the nav orb, can be dragged away and left out in the cold*. And that’s just one example.

If you know how we can make it stop, please please please speak up!

*It’s no longer left in the cold, as we have code that snaps it back to its original position, but we don’t want it to ever leave its original position!

Comments off

We’re a little closer

T googled ‘converting variables in as3’ and figured out that we were extending the class as an Application instead of as a  TouchSprite! We think this is key, except the TouchSprite class doesn’t work as the main app class. But now that I’ve separated the two so the main app class calls the TouchSprite class, I’m getting the dreaded Error #1009: Cannot access a property or method of a null object reference.

ARGGGGHHHHHH!

I’ve been looking for the premature call for over an hour and so far haven’t found a damned thing. Sometimes I really hate Flash. Would it have killed them to give a line number with that error??

ETA: Yeah, this wasn’t the problem. We had to stop using the Marker() class provided by google and create custom markers that we then placed manually on the map. Live and learn!

Comments off

Older Posts »