Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-06-2007, 04:53 PM   #1
ramon
Registered User
 
Join Date: Jan 2003
Location: netherlands
Posts: 3
Question how to put this dynamic buttons in a scrollpane

one of my colleages at work made this code for me.

the xml is read out and on frame one with this code :


// Load in the shop stuff!

var _shopArray:Array = new Array();

shopXML = new XML();
shopXML.ignoreWhite = true;

shopXML.onLoad = function()
{
var root;
root = this.firstChild;
if( root.hasChildNodes() )
{
for( var i = 0; i < root.childNodes.length; i++) {
var _anObject:Object = root.childNodes[i].attributes
_shopArray.push(_anObject);
}
}
gotoAndPlay(2);
}

shopXML.load("shops.xml");

stop();

the second frame makes buttons of the shop places inside the xml file :

// setup buttons

for (var _counter:Number = 0; _counter < 27 ; _counter++) {

var _clipId:String = "button" + _counter.toString();
var _aClip:MovieClip = this.attachMovie("citySelector", _clipId, this.getNextHighestDepth(), {_x:40, _y:80 + (_counter * 18), _cId:_counter});

_aClip.onPress = buttonClicked;

}

stop();

function buttonClicked(event:Object) {

var _shopObject:Object = _level0._shopArray[this._cId];
name.text =_shopObject.company;
address.text = _shopObject.address;
zipcode.text = _shopObject.zipcode;
city.text = _shopObject.place;
site.text = _shopObject.website;
phone.text = _shopObject.tel;

}

the buttons are created perfectly but i can't scroll them and so i wan't to put them in a scrollpane.

can somebody tell me how to attach it to a scrollpane ?
i already enabled the linkage options in flash 8.

Any help would be very appriciated.
ramon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollpane +Dynamic Comboboxes! Groovy Components 0 04-15-2005 10:10 AM
loading dynamic info into scrollpane -- then loading the scrollpane please? chi_grl ActionScript 1.0 (and below) 3 04-18-2004 02:32 PM
here is a script for creating dynamic buttons kamelus ActionScript 1.0 (and below) 3 04-29-2003 03:03 PM
Buttons to control movieclip in scrollpane geniegmu ActionScript 1.0 (and below) 3 04-10-2003 08:49 PM
radio buttons in scrollpane component Philip Toews ActionScript 1.0 (and below) 2 03-20-2003 04:52 PM


All times are GMT. The time now is 06:32 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.