Dynamic text array - Needed to output links

  • nikfiend
  • Novice
  • Novice
  • nikfiend
  • Posts: 20

Post 3+ Months Ago

So what i have is some randomly generated shapes and inside those shapes are dynamic text boxes that randomly generate text from an array. What i can't figure out is how to make the array so each dynamic text box creates a link with the text.
The code i am using for this piece is below and thank you in advance.


Code: [ Select ]
for (i=1; i<=10; i++){
    attachedObj = theScene.attachMovie("shape", "shape"+i, theScene.depth++);
    attachedObj.x = 500 - Math.random()*1000;
    attachedObj.y = 500 - Math.random()*1000;
    attachedObj.z = i*500;
    attachedObj.onPress = selectShape;
    attachedObj.display = displayShape;
    objectsInScene.push(attachedObj);
    attachedObj.result = a[random(a.length)];


a = [ "Page1","Page2","Page3","Page4","Page5","Page6","Page7","Page8","Page9"];
    
    }
  1. for (i=1; i<=10; i++){
  2.     attachedObj = theScene.attachMovie("shape", "shape"+i, theScene.depth++);
  3.     attachedObj.x = 500 - Math.random()*1000;
  4.     attachedObj.y = 500 - Math.random()*1000;
  5.     attachedObj.z = i*500;
  6.     attachedObj.onPress = selectShape;
  7.     attachedObj.display = displayShape;
  8.     objectsInScene.push(attachedObj);
  9.     attachedObj.result = a[random(a.length)];
  10. a = [ "Page1","Page2","Page3","Page4","Page5","Page6","Page7","Page8","Page9"];
  11.     
  12.     }
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

that is quite simple.
Code: [ Select ]
attachedObj.onRelease = function()
{
   getURL("http://google.com");
}
  1. attachedObj.onRelease = function()
  2. {
  3.    getURL("http://google.com");
  4. }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.