Jump to content
Search Community

Xristi

Premium
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Xristi

  1. What is the code to access the x/y properties of the object being dragged. I've seen the x/y property used but it's always referred to as element.x. How do you use dot syntax with a div object that has an ID?
  2. Will this give me the object's relative position within its stated bounds? Might you give me an example of its use in a Draggable function? Thank you!
  3. No, and thank you for your almost instantaneous response! I will do it now...
  4. Hi, I need to get the current position of a dragged object on the completion of its tweening to another location. Here is my code: Draggable.create("#firstNamedQuanDragImage1", {type:"x,y", bounds:"#nQL_DragDropGrid1", edgeResistance:0.5, cursor: "pointer", onDragEnd: function(e) { if (this.hitTest(dropAreasArray[0], overlapThreshold)) { TweenMax.to(this.target, 0.5, {x:ecksPos, y:wyePos, onComplete:resetPermissionsArray_Target}); //disAbleTiles2("2nd"); studentAnswer = "EXPRESSION"; removeCheckAnsButton1(false); function resetPermissionsArray_Target() { var firstTileLocus_X = $("#firstNamedQuanDragImage1").offset(); var firstTileLeft = firstTileLocus_X.left; alert("location of first tile is: " + firstTileLeft); } With this code I get the object location just fine but the tween ends and the object does not continue to its desired x/y position If I remove the the onComplete and its function the tweening completes just fine but, obviously, no position info on the object. Thank you for your invaluable assistance - I'm getting there!
  5. Thank you, Julius! I'll put it in my functions file - won't have to ask next time...
  6. Is it possible to use TweenMax.delayedCall() to run 3 functions simultaneously? If not, can it be done with TimeLineMax?
  7. Hi again, Thank you so much for having this great forum! My first try at an interactive, drag and drop, section of most of my webpages was a disaster w/o GSAP. Then I remembered from my AS3 days (still do it) that these greensock forums had gotten me through a number of difficult coding and design issues. I also remembered that greensock and HTML5 were almost synonymous. I was able to figure out my question, but just having this site available gives me so much more confidence in my ability to learn HTML5 and its greensock applications. So, thank you, Jack, GSAP, and these forums!! I'm sure I'll be back. The new code will be posted to codepen shortly for anyone who is looking for a way to have multiple drag objects with a single drop area where the objects are prevented from being dropped on top of one another.
  8. Hi Jack and anyone else who read my first several posts w/o the codepen. Here is the comment and the url for the codepen is included. I have three draggable objects that I want to have the user place in a single drop cell (darker green). I can only move the first one to the drop cell then it "freezes", although I know it is still draggable as it moves slightly within that cell. The other two drag objects are draggable but only to a certain point within the target then they snap to the cell below them. If I can just get the drag/drop behavior to work - that would be great. I am a long time greensock user but entirely within AS3. I'm a total html5/css/js newbie. https://codepen.io/storyproblemdoctor/pen/qePjZv
  9. OK. It's a small section of a page that I have been working on as a separate object. I have been trying to make it work on my own since I posted and now it doesn't run at all. I'll post again when I've fixed it. Thank you so much for the attention you've given my problem. You're amazing!!
  10. I'm just creating the pages; I have no website yet... shall I re-post and try to do a better job of including the codepen?
  11. Thank you for you prompt reply. Yes, I have a codepen but I didn't understand how to send it with the question and then accidentally sent the post. Perhaps that should have been my first question!
  12. I have three draggable objects that I want to have the user place in a single drop cell (darker green). I can only move the first one to the drop cell then it "freezes", although I know it is still draggable as it moves slightly within that cell. The other two drag objects are draggable but only to a certain point within the target then they snap to the cell below them. If I can just get the drag/drop behavior to work - that would be great. I am a long time greensock user but entirely within AS3. I'm a total html5/css/js newbie. I have a codepen - just don't know how to post it.
  13. Thank you for considering my question. I worked around the problem by publishing the parent fla file as an application.
  14. Hi Carl, I know you don't deal with Flash anymore, but I am desperate to finish this rather large program and graduate with my Ph.D. in December. I have four child swf files that are loaded individually and never appear at the same time. They all load perfectly when the parent is run in the Flash IDE (AS3). However, running the parent outside the IDE as an swf results in only 3 of the 4 loading. I have checked each child swf variable declaration and loader function and all four are identical. Could the estimatedBytes be a determinant? var queueIE:LoaderMax = new LoaderMax(); var queueLoader:SWFLoader = new SWFLoader("IntExtCode.swf", {name:"swfIE_loader", estimatedBytes:210000, container:this, x:5, y:5, autoPlay:false, onComplete:completeIE_Handler}); function completeIE_Handler(event:LoaderEvent):void { event.target.rawContent.setProbNumber(problemNumber); event.target.rawContent.setProbText(problemText); var myQueue:MovieClip = MovieClip(event.target.rawContent); myQueue.closeButton.addEventListener(MouseEvent.Click, closeIE_Utility); } function closeIE_Utility(event:MouseEvent):void { queueIE.getLoader("swfIE_Loader").unload(); } function loadIE_FlowChart():void { this.addChildAt(queueIELoader.content, this.numChildren); queueIE.append(queueIELoader); queueIE.load(); } Thank you for any help you can give me, ChristiAnne
  15. I found it. I did it. I made the MCs alpha = 0 when the swf loaded. It's been months since I have coded this part of my ITS and I forgot I had done it to avoid some of the MCs floating over the swf - a jury-rigged solution to be sure...again, thank you for your quick attention to my question and I apologize for posting unnecessarily.
  16. Hi, I know you are not supporting Flash AS3 anymore, however, perhaps you can give me a quick tip (you did this on another issue and your tip solved the problem) as to why some of the movieclips on the parent disappear when the SWF is unloaded. I am using- var queueIE:LoaderMax = new LoaderMax; queueIE.append(new SWFLoader("IntExtCode.swf", {name:"swfIE_Loader",estimatedBytes:90000, container:this, x:5,y:10, autoplay:false, onComplete:completeIE_Handler})); in the complete handler is a listener for the close button which executes: queue.getLoader("swfIE_Loader").unload(); the swf is unloaded very nicely, but several of the movieclips (but not all) are removed as well. Any thoughts would be greatly appreciated!! Xristi
  17. Hi, I found the answer to my question in a 2010 response from Jack, "Eventlistener for a button in loaded SWF" using your tip and works perfectly. Thank you for your help!! and for GreenSock!
  18. OK- Thank you for the tip. Appreciate your taking the time to respond... Xristi
  19. Hello, I am using LoaderMax to load a child swf and it works very well, including the transfer of two variables from parent to child. However, I cannot locate any code (understandable to me) on this forum that indicates the code necessary in the parent and the code necessary in the child to accomplish this. I was able to do it in AS3 with a listener or two and a dispatch event but couldn't transfer the variables. I'd much rather use LoaderMax anyway. This is the code for the loader in the parent: queueIE.append(new SWFLoader("IntExtCode.swf", {name:swfMainLoader", estimated bytes:90000, container:this, x:5, y:10, autoPlay:false, onComplete:completeHandler})); function completeHandler(event:LoaderEvent):void { event.target.rawContent.setProbNumber(catPracProblemNumber); event.target.rawContent.setProbText(practiceProblemText_txt.text); } Can I put a listener (COMPLETE) in this function and use my regular as3 code that dispatches an event with a dispatchEvent in the child code? Thank you for any help you can give me
  20. Yes, I tried to make it as bare bones as possible, but still retain what I really wanted to do, as long as I had your help Thank you once again, for your patience and considerable expertise. Your code works great... now on to coding seconds to minutes and minutes to hours.
  21. Hi Carl, Yes, what you have worked. However, I am building a count down timer so it needs to delay the one second each time the delayed call is made. I have attached a small zipped fla file. The program goes to the delayed call function after one second, but then accesses that function without regard to the delay. Is there another code bit that has to go inside the parentheses so that the trace statement is printed nine times with a one second interval between each printing? CountDownTrial.zip
  22. Hi, I don't imagine this is a terribly difficult problem to solve - perhaps I can't see the forest through the trees. I have the following: TweenMax.delayedCall(1, countDown); function countDown():void { unitSec = int(inputTextFieldsArray[0].text); unitSec--; inputTextFieldsArray[0].text = String(unitSec); } if I append parentheses to the countDown function, the function is called and it counts down from whatever number is in the textfield like it's supposed to. Unfortunately, it doesn't pay any attention to the 1 second delay. Without the parentheses the function doesn't fire. Thank you for any help you can give me! The documentation shows no parentheses...
  23. Thank you for the response, I get: 1[object ContentDisplay] 2[object MovieClip] 3[object ParentMain] 4[object Stage] so one index off from yours. I checked my code and couldn't find any differences - but there must be something. I will look at it again, soon. Again, thank you so much! I learned more about as3 than just how to read variables/functions between parent and child-
  24. Hi, Finally got it to work. Thank you very much again, for your patience and expertise. I did have to juggle the number of parent(s) in ChildMain. The trace statement in init() took 4 and the MovieClip took 3 to get rid of the runtime errors variously regarding null objects and illegal conversions. This is how it looks in my code now: if(this.parent.parent) { trace("it's here"); trace("init " + this.parent.parent.parent.parent); //call a function in the parent fla MovieClip(this.parent.parent.parent).doStuff(); } As you can tell, I added parent (s), moving up the display list, until I received no RT errors - I see that you used 5 and 4. Why would it be different on your computer or is there something I am missing in my knowledge of such things?
×
×
  • Create New...