dynamic txt problem. hlp!

  • TvFreak
  • Newbie
  • Newbie
  • TvFreak
  • Posts: 12

Post 3+ Months Ago

Hi all;

im currently doing drag and drop activity.

i hav this dynamic text called batteryAns
i need the batteryAns to appear correctly on top of the object.

the sequence is

if u drag the battery> scale> water in cylinder >back to shelf> batteryAns appear
or battery> water in cylinder > scale>back to shelf> batteryAns appear

i have two codes area which is at frame 1 action layer and frame 35 at inside waterBattery layer there is a mc called waterBattery_mc.

sum1 hlp me..please...ty


ps: jus drag the battery, juz ignore the other items.

http://www.filewire.com/download.php?id=ab12397e1c6a6de281630b2
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • TvFreak
  • Newbie
  • Newbie
  • TvFreak
  • Posts: 12

Post 3+ Months Ago

i created a dynamic txt called batteryAns

i need it to appear this way

drag batt> scale > measuring cylinder > back to shelf > batteryAns Appear

or

drag batt> measuring cylinder > scale > back to shelf > batteryAns Appear


my problems are

i dunwan it too appear wen

drag batt>scale >back to shelf > batteryAns appear

or

drag batt> measuring cylinder > back to shelf > battery appear

or

wen u done wif

drag batt> scale > measuring cylinder > back to shelf > batteryAns Appear >drag again to the scale > batteryAns will not dissappear

or

drag batt> measuring cylinder > scale > back to shelf > batteryAns Appear >drag again to the cliynder > batteryAns will not dissappear


please sum1 hlp me
ur hlp is greatly needed

thank u
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

do u have a starter FLA that u been working on ?
  • TvFreak
  • Newbie
  • Newbie
  • TvFreak
  • Posts: 12

Post 3+ Months Ago

yes i do.

it is at my 1st post
theres a link where u cn d/l my fla file
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

okay im gonna give u a quick thing to try ya ...

create 2 Boolean Vars one for the scale and one for mesuring cyln. name them Z1 , Z2 ...set them both to FALSE.

if hit test with scale , Z1 = TRUE
if then hit test with Measurin Cyln. , Z2 = TRUE .

Now when you return it back to shelf ( hittest with shelf is true ) make an if statement ...

if (Z1 && Z2 = TRUE ) {
dynamictext._visible= true ;
}else{
dynamictext._visible = false;
}

something like that ...
  • TvFreak
  • Newbie
  • Newbie
  • TvFreak
  • Posts: 12

Post 3+ Months Ago

hi classified.
thank u for replying to me.
yes i did as wat u had mention

i created 3 variables tht is dropBool(scale),waterBool(cylinder) and ansBool(batteryAns)

the codes are working well but there is a slight problem.

i hav two hitTest which is one at the 'shelf' and the other is at 'else'. the x and y hits the same co ordinates.

as for hitTest at 'shelf '

dropBool and waterBool need to false and ansBool need to b true to allow BatteryAns visible.

as for hitTest at 'else'

All,dropBool,waterBool and ansBool need to false
to make batteryAns nt visible.


-so the problem is

if u drag batt > scale > back to shelf > batteryAns appear.

or

if u juz double click the battery at the shelf itself , batteryAns will appear also cause it hit the same place.

i need the user to do the drag n drop activity 1st before getting the answer.

How can i solve this? i tried so many ways but still cannot work.



Code: [ Select ]
else if (this.hitTest(_root.shelf_mc)) {
        dropBool = false;
        waterBool = false;
        answer2();
        ansBool = true;
        answer();
        this._x = 88.5;
        this._y = 31;
        _root.answer1 = "";
        _root.answer2 = "";
        _root.answer3 = "";
        _root.endComment = "";
        _root.batteryAns._visible = true;
        _root.msg_mc._visible = false;
        _root.water_mc._visible = true;
        _root.waterBattery_mc.gotoAndStop(1);
        _root.error_mc.gotoAndStop(1);
        enabler("crazly", true);
        trace(shelf_mc+" "+ "shelf");
  1. else if (this.hitTest(_root.shelf_mc)) {
  2.         dropBool = false;
  3.         waterBool = false;
  4.         answer2();
  5.         ansBool = true;
  6.         answer();
  7.         this._x = 88.5;
  8.         this._y = 31;
  9.         _root.answer1 = "";
  10.         _root.answer2 = "";
  11.         _root.answer3 = "";
  12.         _root.endComment = "";
  13.         _root.batteryAns._visible = true;
  14.         _root.msg_mc._visible = false;
  15.         _root.water_mc._visible = true;
  16.         _root.waterBattery_mc.gotoAndStop(1);
  17.         _root.error_mc.gotoAndStop(1);
  18.         enabler("crazly", true);
  19.         trace(shelf_mc+" "+ "shelf");


Code: [ Select ]
else {
        dropBool = false;
        waterBool = false;
        answer2();
        ansBool = false;
        answer();
        battery_mc._alpha =100;
        this._x = 88.5;
        this._y = 31; 
        _root.answer3 = "";
        _root.answer1 = "";
        _root.answer2 = "";
        _root.endComment = "";
        _root.msg_mc._visible = false;
        _root.water_mc._visible = true;
        _root.waterBattery_mc.gotoAndStop(1);
        _root.error_mc.gotoAndStop(1);
        enabler("crazly", true);
    }
  1. else {
  2.         dropBool = false;
  3.         waterBool = false;
  4.         answer2();
  5.         ansBool = false;
  6.         answer();
  7.         battery_mc._alpha =100;
  8.         this._x = 88.5;
  9.         this._y = 31; 
  10.         _root.answer3 = "";
  11.         _root.answer1 = "";
  12.         _root.answer2 = "";
  13.         _root.endComment = "";
  14.         _root.msg_mc._visible = false;
  15.         _root.water_mc._visible = true;
  16.         _root.waterBattery_mc.gotoAndStop(1);
  17.         _root.error_mc.gotoAndStop(1);
  18.         enabler("crazly", true);
  19.     }


ps: heres the link for my updated fla file

http://www.filewire.com/download.php?id=9382f33a1c6aa3565edf01e




note: i hav to code area. One at layer name action frame 1 and the other one is at layer name waterBattery,it is inside a movieClip frame35

theres two code area becoz i made it so tht the user can drag out the battery out frm the water once the water animation is done.

sori if it is a bit wordy. 8)

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 8 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.