How to control a photo gallery mc from within another mc as2

  • Tw1ntus
  • Born
  • Born
  • Tw1ntus
  • Posts: 1

Post 3+ Months Ago

0 down vote favorite


I found AS for my photo galley and its working fine on the main frameline. Problem is that I want to put it inside of the other mc (sliding out menu) and there it stops working, without errors.

Sliding menu is: menu_mc and inside of that should be my gallery. And like I said script working fine on the main scene. Any help would be appreciated.

Code: [ Select ]
var numOfPix:Number = 6;
var pos:Array = [0, 190, 380, 570, 860, 1050];
var theInfo:Array = ["The First Car", "The Second Car", "The Third Car", "The Fourth Car", "The Fifth Car", "The Sixth Car"];
var w:Number = _level0.the1_btn._width;
var h:Number = _level0.the1_btn._height;
//~~~ The text Format ~~~
var theFmt:TextFormat = new TextFormat();
theFmt.align = "center";
theFmt.color = 0xFF6600;
theFmt.font = "theFont";
theFmt.size = 20;
theFmt.bold = true;
//
for (i=1; i<=numOfPix; i++) {
  _level0["the"+i+"_btn"].createTextField("theNum_txt", 1, 0, 0, w, h);
  _level0["the"+i+"_btn"].theNum_txt.text = i;
  _level0["the"+i+"_btn"].theNum_txt.setTextFormat(theFmt);
}
//
_level0.info_txt.selectable = false;
_level0.info_txt.setNewTextFormat(theFmt);
//
for (i=1; i<=pos.length; i++) {
  _level0["the"+i+"_btn"].n = i;
  _level0.info_txt.text = _level0.theInfo[0];
  _level0["the"+i+"_btn"].onRelease = function() {
    _level0.thePix_mc.panorama_mc._x = _level0.pos[this.n-1]*-1;
    _level0.info_txt.text = _level0.theInfo[this.n-1];
  };
}
  1. var numOfPix:Number = 6;
  2. var pos:Array = [0, 190, 380, 570, 860, 1050];
  3. var theInfo:Array = ["The First Car", "The Second Car", "The Third Car", "The Fourth Car", "The Fifth Car", "The Sixth Car"];
  4. var w:Number = _level0.the1_btn._width;
  5. var h:Number = _level0.the1_btn._height;
  6. //~~~ The text Format ~~~
  7. var theFmt:TextFormat = new TextFormat();
  8. theFmt.align = "center";
  9. theFmt.color = 0xFF6600;
  10. theFmt.font = "theFont";
  11. theFmt.size = 20;
  12. theFmt.bold = true;
  13. //
  14. for (i=1; i<=numOfPix; i++) {
  15.   _level0["the"+i+"_btn"].createTextField("theNum_txt", 1, 0, 0, w, h);
  16.   _level0["the"+i+"_btn"].theNum_txt.text = i;
  17.   _level0["the"+i+"_btn"].theNum_txt.setTextFormat(theFmt);
  18. }
  19. //
  20. _level0.info_txt.selectable = false;
  21. _level0.info_txt.setNewTextFormat(theFmt);
  22. //
  23. for (i=1; i<=pos.length; i++) {
  24.   _level0["the"+i+"_btn"].n = i;
  25.   _level0.info_txt.text = _level0.theInfo[0];
  26.   _level0["the"+i+"_btn"].onRelease = function() {
  27.     _level0.thePix_mc.panorama_mc._x = _level0.pos[this.n-1]*-1;
  28.     _level0.info_txt.text = _level0.theInfo[this.n-1];
  29.   };
  30. }
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

Well just doing a quick look over your code it seem like your calling the main timeline to do the button actions _level0 Give the slide out an instance name and use that. instance name of slideout slideout["the"+i+"_btn"].n = i; or something like that if you could post the fla I could be a bit more help.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 5 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
 
cron
 

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