Jump to content
xisto Community

BlueInkAlchemist

Members
  • Content Count

    55
  • Joined

  • Last visited

Everything posted by BlueInkAlchemist

  1. As an update, I did get this sort of working by adding a button that brings in the scrollbar as a separate function. This works after the text's transition has completed. Perhaps I can simply tie the scrollbar function to a timer that fires when the text begins to load?
  2. Greetings, all! I'm using the techniques discussed in this thread on ActionScript.org to load formatted HTML text into flash. I also want to scroll said text, and for that purpose I'd like to use Flashscaper's scrollbar. I've run into a bit of a snag, however. The text displays fine. However, the scrollbar does not appear when initiated and the mask (a red rectangle) can be seen on the right side of the content area; not the entire thing, just a red area about 5-10 pixels wide. The text can be scrolled using the mouse wheel, so the scrollbar functionality is intact. I think this has something to do with the transition within the ContentText function, but when I comment that out, the text doesn't display at all, nor does the scrollbar. Listed below are the three components to this project. ContentText.as: package{ import flash.display.MovieClip; import flash.text.*; import fl.transitions.*; import fl.transitions.easing.*; import flash.text.StyleSheet; import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.*; public class ContentText extends MovieClip { private var myURLLoader:URLLoader; private var myURLRequest:URLRequest; private var bodyTextField:TextField; public var contentPage:String; public var myTransitionManager:TransitionManager; public function ContentText(paraString:String) { contentPage = paraString; myURLLoader = new URLLoader(); myURLRequest = new URLRequest("data/styles.css"); myURLLoader.addEventListener(Event.COMPLETE, onLoadCSS); myURLLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); myURLLoader.load(myURLRequest); } private function ioErrorHandler(evt:IOErrorEvent):void { trace('download failed'); } private function onLoadCSS(event:Event):void { bodyTextField = new TextField(); var css:StyleSheet = new StyleSheet(); css.parseCSS(event.target.data); myURLRequest = new URLRequest(contentPage); bodyTextField.x = 50; bodyTextField.y = 50; bodyTextField.width = 200; bodyTextField.height = 200; bodyTextField.multiline = true; bodyTextField.wordWrap = true; bodyTextField.autoSize = TextFieldAutoSize.LEFT; bodyTextField.selectable = false; bodyTextField.styleSheet = css; bodyTextField.condenseWhite = true; addChild(bodyTextField); myURLLoader.removeEventListener(Event.COMPLETE, onLoadCSS); myURLLoader.addEventListener(Event.COMPLETE, onHTMLLoaded); myURLLoader.load(myURLRequest); } private function onHTMLLoaded(evt:Event):void {// trace(evt.target.data); bodyTextField.htmlText = evt.target.data; myTransitionManager = new TransitionManager(this); myTransitionManager.startTransition({type:Wipe, direction:Transition.IN, duration:5.5, easing:None.easeOut}); } }} Scrollbar.as: /** * Flashscaper Scrollbar Component * Customizable Scrollbar * * @author Li Jiansheng * @version 1.0.0 * @private * @website [url="http://forums.xisto.com/no_longer_exists/; */package { import caurina.transitions.*; import flash.display.*; import flash.events.*; import flash.geom.*; public class Scrollbar extends MovieClip { private var target:MovieClip; private var top:Number; private var bottom:Number; private var dragBot:Number; private var range:Number; private var ratio:Number; private var sPos:Number; private var sRect:Rectangle; private var ctrl:Number;//This is to adapt to the target's position private var trans:String; private var timing:Number; private var isUp:Boolean; private var isDown:Boolean; private var isArrow:Boolean; private var arrowMove:Number; private var upArrowHt:Number; private var downArrowHt:Number; private var sBuffer:Number; public var scroller:MovieClip; public var track:MovieClip; public var downArrow:MovieClip; public var upArrow:MovieClip; public function Scrollbar():void { scroller.addEventListener(MouseEvent.MOUSE_DOWN, dragScroll); } // public function init(t:MovieClip, tr:String,tt:Number,sa:Boolean,b:Number):void { target = t; trans = tr; timing = tt; isArrow = sa; sBuffer = b; if (target.height <= track.height) { this.visible = false; } scroller.addEventListener(MouseEvent.MOUSE_OUT, stopScroll); scroller.addEventListener(MouseEvent.MOUSE_UP, stopScroll); stage.addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheelHandler); // upArrowHt = upArrow.height; downArrowHt = downArrow.height; if (isArrow) { top = scroller.y; dragBot = (scroller.y + track.height) - scroller.height; bottom = track.height - (scroller.height/sBuffer); } else { top = scroller.y; dragBot = (scroller.y + track.height) - scroller.height; bottom = track.height - (scroller.height/sBuffer); upArrowHt = 0; downArrowHt = 0; removeChild(upArrow); removeChild(downArrow); } range = bottom - top; sRect = new Rectangle(0,top,0,dragBot); ctrl = target.y; //set Mask isUp = false; isDown = false; arrowMove = 10; if (isArrow) { upArrow.addEventListener(Event.ENTER_FRAME, upArrowHandler); upArrow.addEventListener(MouseEvent.MOUSE_DOWN, upScroll); upArrow.addEventListener(MouseEvent.MOUSE_UP, stopScroll); // downArrow.addEventListener(Event.ENTER_FRAME, downArrowHandler); downArrow.addEventListener(MouseEvent.MOUSE_DOWN, downScroll); downArrow.addEventListener(MouseEvent.MOUSE_UP, stopScroll); } var square:Sprite = new Sprite(); square.graphics.beginFill(0xFF0000); square.graphics.drawRect(target.x, target.y, target.width+5, (track.height+upArrowHt+downArrowHt)); parent.addChild(square); target.mask = square; } public function upScroll(event:MouseEvent):void { isUp = true; } public function downScroll(event:MouseEvent):void { isDown = true; } public function upArrowHandler(event:Event):void { if (isUp) { if (scroller.y > top) { scroller.y-=arrowMove; if (scroller.y < top) { scroller.y = top; } startScroll(); } } } // public function downArrowHandler(event:Event):void { if (isDown) { if (scroller.y < dragBot) { scroller.y+=arrowMove; if (scroller.y > dragBot) { scroller.y = dragBot; } startScroll(); } } } // public function dragScroll(event:MouseEvent):void { scroller.startDrag(false, sRect); stage.addEventListener(MouseEvent.MOUSE_MOVE, moveScroll); } // public function mouseWheelHandler(event:MouseEvent):void { if (event.delta < 0) { if (scroller.y < dragBot) { scroller.y-=(event.delta*2); if (scroller.y > dragBot) { scroller.y = dragBot; } startScroll(); } } else { if (scroller.y > top) { scroller.y-=(event.delta*2); if (scroller.y < top) { scroller.y = top; } startScroll(); } } } // public function stopScroll(event:MouseEvent):void { isUp = false; isDown = false; scroller.stopDrag(); stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveScroll); } // public function moveScroll(event:MouseEvent):void { startScroll(); } public function startScroll():void { ratio = (target.height - range)/range; sPos = (scroller.y * ratio)-ctrl; Tweener.addTween(target, {y:-sPos, time:timing, transition:trans}); } }} texttext.fla: import ContentText; var ct:ContentText; var sb:MovieClip;ct = new ContentText("data/loremipsum.htm");ct.x = 100.0;ct.y = 50.0;addChild(ct);sb = new Scrollbar;sb.x = 500.0;sb.y = 50.0;addChild(sb);sb.init(ct,"easeOutSine",2,true,2); I know it's a lot of code, but any help that you can provide would be greatly appreciated! :cool:
  3. In the previous filing, I did go through an attorney. The experience was a decidedly unpleasant one, as I do not feel I was adequately represented. It's not something I'm eager to do again.
  4. My wife and I have been separated for four years. I filed for divorce in 2005 while living in Butler County, PA. My wife never signed the papers, and I've been informed that as of October 18 of this year the case has been discontinued. I know for a fact my wife has no interest in reconciling with me, nor I with her.I now live in Montgomery County and have the option to e-file a new motion for divorce decree. How will my separation status affect the nature of the case? Butler County did not automatically grant the divorce, would law in Montgomery County different? Will I be able to do research at my local library, or is there a specific source I should be looking into?
  5. I'll have to try this out, see if it will preserve HTML text formatting when taken from the source page into Flash...
  6. What about XML? For example, within Flash, ActionScript will read the nodes of an XML file which contain external file names, corresponding variables, etc. On an event (a Mouse Click more than likely), the selected variable will load the corresponding external file in a content area. That's the rough idea.
  7. Basically, what I want to do is, within a Flash movie, when a navigation button is selected, a content area (a MovieClip more than likely) should be populated with formatted text from an outside page. Also, this is going to be hosted on my domain which is currently held by Microsoft Office Live, meaning it's an ASP-based site. It'll be ASP wrapped around Flash, but still.
  8. @ rayzoredge - Thanks for your response. I don't own an HD television or a surround sound rig separate from my PC's sound system, so I'm not worried about HDMI or component cables or any of that stuff. I wouldn't mind a headset, however, given that I'd like to be able to play Team Fortress 2 in a capacity other than a bullet-absorbing newb. Despite already having Half-Life 2 and Portal on my main PC under Steam, I plan on getting The Orange Box as one of my first XBox 360 purchases. That, BioShock and Assassin's Creed will probably be my firsts.
  9. So I'm thinking of getting an XBox 360. But do I buy the Arcade or the Pro?The Arcade is much cheaper but does not include an HDD. I can buy that separately but I'd have to go without initially. The Pro comes with an HDD but also comes with games I don't necessarily want to play, and is more expensive.What is the opinion(s) of Trap 17?
  10. I think it's subjective, to be honest. There's something for everyone if you know where to look. And if you're not into the subject matter or presentation, no matter how good the game engine is you're not going to like it.Say for example you like fantasy, but you prefer it "visceral" or "realistic". World of Warcraft isn't going to appeal to you. Conversely, if you're not really into Conan, Age of Conan won't be your thing. And Battlestar Galactica fans aren't going to enjoy either of those but will tend towards Eve Online.And then there's all of the free ones. Basically, just spend a little time on Google doing some research, and you'll find something that you're bound to enjoy.
  11. Since ActionScript.org appears to be down, I'm going to annoy you all with more design questions. :)I know I can use the getURL and URLLoader classes to bring HTML content into Flash. But can these also be used if I only want to show part of an HTML page? For example, if the content I want to show is in a <div> tag, and that's all I want to show, how would I go about calling for that part of the HTML source?Thanks in advance...
  12. Death doesn't really frighten me. Things die, it's part of life. I'm a Christian, so I believe in the persistence of the soul after death, but I also acknowledge the possibility of that being false. If it turns out to be false, I won't care, seeing as I'll be dead. If it's true, however, it's something to look forward to, so I focus on the possibility of encountering loved ones again rather than dwell on the futility of life itself. I'm not THAT emo.
  13. Thanks so much for your help, sonesay. Do you think it might be possible to call the code using Flash? I tried a couple of solutions that way but so far I haven't had any success.
  14. Some advice I once got from a fellow writer: "If you can't find the book you want to read on the store shelves, write it."Does the same thing apply to guilds?I've been trying to find a guild that has the right balance of casual PvE and mature RP. Since leaving one after disagreeing with some officers' leadership style (though I still adore my old GL) and the collapse of another, most guilds seem to be a cavalcade of mediocrity. I know a lot of work would have to go into starting and maintaining a guild, but if I can make it work and found the kind of atmosphere I and others are craving, it might be more than worth it.What has your experience been?
  15. I think it did, yes. What I might due is use the established domain as a "front page", and put in links to PhP pages hosted here, such as forums and places for people to log in and comment. I'm also working on earning enough credits to get my first myCent... I'm up to 56.something at the moment. Thanks for your input!
  16. The test page itself: <html><head><script src="jquery-latest.js" type="text/javascript"></script><script type="text/javascript">function loadAds(){ // generate random number (0-1). var iRandom = Math.floor(Math.random()*2); var x; if(iRandom == 0) { x = "theOtherPage.htm ul#favoriteMovies"; } else if(iRandom == 1) { x = "theOtherOtherPage.htm div#adspace"; } // original loading code. $("#loadData").text("...One Moment Please..."); $("#container").append('<div id="content"></div>') .children("#content").hide() .load(x, function() { $("#loadData").remove(); $("#content").show(); });}</script><title>Load Test</title><body onload='setInterval("loadAds()", 10000);'></head><div id="container"> <a href="#" id="loadData">Click This Link To Load My Favorite Movies</a></div></body></html> TheOtherPage.htm: <ul id="favoriteMovies"><li style="font-weight: bold; list-style-type: none;">My Favorite Movies</li><li>The Boondock Saints</li><li>Lord of the Rings</li><li>Smokin' Aces</li><li>Batman Begins</li><li>The Dark Knight</li><li>Deja Vu</li><li>Big Trouble in Little China</li><li>Shoot 'Em Up</li></ul> TheOtherOtherPage.htm: <div id="adspace"><script type="text/javascript"><!--google_ad_client = "*snip snip*";/* 300x250, Ad Module */google_ad_slot = "*snip snip*";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://*snip snip*/show_ads.js"></script></div>
  17. Currently, my website (blueinkalchemy.com) is hosted by Microsoft's Office Live service. The upside is, the hosting is free. On the other hand, the site must be coded in ASP, any database solutions need to be tied to Micro$oft, and I don't have a great deal of space. I was told I need to call Microsoft in order to get my domain moved, and that move might cost me money I don't have.However, I'm not sure if a move is necessary. I get the impression that PhP is more flexible than ASP, especially when MySQL is added to the mix, but considering what I mostly want to do is establish a web presence for my writing, ASP might be adequate. I wouldn't mind having people register for the site in order to protect my intellectual property and send people e-mail updates if they wish.What have your experiences been with ASP, PhP or both? What would you recommend?
  18. Great solution, the functionality and theories are sound, only problem is the ad content won't display. I alternate between some static text (an unordered list pulled from one page) and the JavaScript for Google Ads listed above, and while the ul items come in fine, the div holding the ad module does not. The ad page loads fine by itself, so the div is not a hindrance to it on that page.
  19. There are going to be multiple ad units - for the sake of argument, ads1.html, ads2.html and the like will work for example's sake. Keeping them in separate files that are loaded on demand and unloaded when the next loads would, I believe, cut down on overall load times and allow the ads to run as intended by their owners. Say ads1.html has a 30-second unit and ads2.html has a 60-second unit. If they were loaded onto the same page at the same time, even if ads2.html's content is hidden, when it's shown as ads1.html's content is hidden it'll be showing from the middle of the ad, not the start. ...Did I explain that properly?
  20. @truefusion: Bless you. I don't mind working entirely with JavaScript if I can get it to function the way I want. The objective of this project is to display advertising content in a div, parceled out to clients in 30-second increments. Basically, one ad will show within the div for 30 seconds, to be replaced by another. The nature of most adverts means Flash is unable to accommodate this need, and using Ajax or an IFRAME violates Google's terms of service, since we use Google Ads and other clients may do the same or use a similar service with similar terms. So, in essence, the script needs to: 1. Define the sources of the adverts 2. Set up and run a 30-second timer 3. Dynamically load, display, and unload the content defined in step 1 according to the increments of the timer from step 2. 1 and 2 are simple enough, and here's what I'm working on so far to accomplish 3. The source file is "OtherPage.htm": <div id="someAds"><script type="text/javascript"><!--google_ad_client = "*snip*";/* 300x250, etc */google_ad_slot = "*snip*";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://*snip*/show_ads.js"></script></div> This is what I want to load via a JQuery function in "QueryTest.html": <html><head><script src="jquery-latest.js" type="text/javascript"></script><script type="text/javascript">$(document).ready(function() { var x = "OtherPage.htm div#someAds"; $("#loadData").click(function() { $(this).text("...One Moment Please..."); $("#container").append('<div id="someAds"></div>') .children("#someAds").hide() .load(x, function() { $("#loadData").remove(); $("#someAds").show(); }); return false; });});</script><title>Load Test</title></head><body><div id="container"> <a href="#" id="loadData">Click This Link To Load The Ads</a></div></body></html> Simple, eh?
  21. Greetings all, Lately I've been looking into things JQuery can do for me in terms of development. Specifically, I'm looking at this demo: http://forums.xisto.com/no_longer_exists/ In this situation, is it possible for the target file being loaded to be defined as a variable instead of a relative or absolute path? Specifically, if there were more than one div on the page, and each div were to contain different external content, how would the same function be used for each div? Thanks in advance. EDIT: After a tweak or two, the JQuery function on my page looks like this: $(document).ready(function() { var x = "theOtherPage.htm ul#favoriteMovies"; $("#loadData").click(function() { $(this).text("...One Moment Please..."); $("#container").append('<div id="favoriteMovies"></div>') .children("#favoriteMovies").hide() .load(x, function() { $("#loadData").remove(); $("#favoriteMovies").slideDown("slow"); }); return false; });}); Looking to see if I can define 'x' outside of the function...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.