Re: [Flashcoders] Flashing Flash
- Original Message From: Keith Reinfeld keithreinf...@comcast.net To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wed, May 19, 2010 1:53:06 PM Subject: RE: [Flashcoders] Flashing Flash Don't remove container_middle at all. Instead add/remove its children: container_middle.addChildAt(newImage, 0); container_middle.removeChildAt(1); Well I thought that was a pretty slick idea, and cleaner code all the way around. However, no cigar. I had to place the new code further down. Here's what I ended up with: function LoadLeft():void { if(start_flag == true) { container_left = new Sprite(); big_container.addChild(container_left) } else { big_container.removeChild(container_left2); } var path:String = images/left + i + .png; var req:URLRequest = new URLRequest(path); var loader:Loader = new Loader(); loader.load(req); loader.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void{ trace(e) }); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadLeftLoaded); } function LoadLeftLoaded(evt:Event):void { var loaderInfo:LoaderInfo = evt.target as LoaderInfo; var displayObject:DisplayObject = loaderInfo.content; displayObject.width = 319; displayObject.height = 502; container_left.addChildAt(displayObject, 0); if(start_flag == false) { container_left.addChildAt(displayObject, 0); try { container_left.removeChildAt(1); } catch(error: Error) { trace('Error in removwChildAt(1)'); } } else { container_left.addChild(displayObject); } if(start_flag2 == true) { container_left.x = 1000; container_left.y = 20; } else { container_left.x = 30; container_left.y = 20; } var timeline:TimelineLite = new TimelineLite({onComplete:SpinLeft}); timeline.append(new TweenLite(container_left, 1, {x:30, y:20})); } Nonetheless, it still blinks at me as before :( TIA, John ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] tint a movieclip
Thanks, Juan. What I'm really looking for is how to extract values for redMultiplier, greenMultiplier and blueMultiplier out of a given color hex value, say #336699. - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] tint a movieclip
Hi Michael, are you looking for something like this: var red:Number = (pColorValue 16) 0xff; var green:Number = (pColorValue 8) 0xff; var blue:Number = (pColorValue ) 0xff; regards JC On Thu, May 20, 2010 at 3:07 PM, Mendelsohn, Michael michael.mendels...@fmglobal.com wrote: Thanks, Juan. What I'm really looking for is how to extract values for redMultiplier, greenMultiplier and blueMultiplier out of a given color hex value, say #336699. - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Upgrade from MX2004 to CS4 - issues?
I'm covering for a colleague and am working on their Flash projects using MX2004, which . However, I just discovered that we have a license for CS4 but that she's stuck with the older version because of 'compatibility' problems. Any idea what these are? She isn't around to ask. Part of the picture is that we have a couple of templates in AS1 - will CS4 meddle with these in anyway? TIA Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] tint a movieclip
Thanks JC, I think that's it! - MM are you looking for something like this: var red:Number = (pColorValue 16) 0xff; var green:Number = (pColorValue 8) 0xff; var blue:Number = (pColorValue ) 0xff; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] tint a movieclip
That number does not have any multipliers. Multipliers are not raw colors. They are an effect that you do to the colors of some object. They depend on what the original color was. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Upgrade from MX2004 to CS4 - issues?
You won't be able to save as a MX2004 file from CS4. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Jinks Sent: Thursday, May 20, 2010 9:27 AM To: Flash Coders List Subject: [Flashcoders] Upgrade from MX2004 to CS4 - issues? I'm covering for a colleague and am working on their Flash projects using MX2004, which . However, I just discovered that we have a license for CS4 but that she's stuck with the older version because of 'compatibility' problems. Any idea what these are? She isn't around to ask. Part of the picture is that we have a couple of templates in AS1 - will CS4 meddle with these in anyway? TIA Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] NativeWindow options
I'm having trouble finding examples of how to get html in NativeWindows to scale as I want. The following makes a portion of the HTML the size of the window that spawned it visible. I need to launch a resizable window and have HTML completely fill it at an arbitrary size. Help? Thanks! var options:NativeWindowInitOptions = new NativeWindowInitOptions(); options.maximizable = true; options.resizable = true; var twitter:NativeWindow = new NativeWindow(options); twitter.stage.scaleMode = StageScaleMode.NO_SCALE; twitter.stage.align = StageAlign.TOP_LEFT; twitter.activate(); var html:HTMLLoader = new HTMLLoader(); var urlReq:URLRequest = new URLRequest(twitter.html); html.load(urlReq); twitter.stage.addChild(html); _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Upgrade from MX2004 to CS4 - issues?
Thanks Eric I'm guessing that this won't be a problem, since once we've made the move we won't need to save files for MX2004. Will transitioning to CS4 disrupt the files in anyway e.g. render the code differently - the adobe documentation suggests that AS1 is supported in CS4 - can anyone confirm this? Sorry for being so vague. I'm trying to guess what the problems anticipated might have been. Cheers Paul On 20 May 2010 16:01, Mattheis, Erik (MIN - WSW) ematth...@webershandwick.com wrote: You won't be able to save as a MX2004 file from CS4. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Jinks Sent: Thursday, May 20, 2010 9:27 AM To: Flash Coders List Subject: [Flashcoders] Upgrade from MX2004 to CS4 - issues? I'm covering for a colleague and am working on their Flash projects using MX2004, which . However, I just discovered that we have a license for CS4 but that she's stuck with the older version because of 'compatibility' problems. Any idea what these are? She isn't around to ask. Part of the picture is that we have a couple of templates in AS1 - will CS4 meddle with these in anyway? TIA Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Paul Jinks Assistant Development Librarian University of Sheffield Library Tel: [0114 22] 27235 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Upgrade from MX2004 to CS4 - issues?
I have this vague memory that texts all went weird if you export to SWF from MX2004 FLA in Flash 8 - but not 100% certain as this is a long time ago now... :) There's only one way to find out? -- Kenneth Kawamoto http://www.materiaprima.co.uk/ On 20 May 2010 16:40, Paul Jinks p...@pauljinks.co.uk wrote: Thanks Eric I'm guessing that this won't be a problem, since once we've made the move we won't need to save files for MX2004. Will transitioning to CS4 disrupt the files in anyway e.g. render the code differently - the adobe documentation suggests that AS1 is supported in CS4 - can anyone confirm this? Sorry for being so vague. I'm trying to guess what the problems anticipated might have been. Cheers Paul On 20 May 2010 16:01, Mattheis, Erik (MIN - WSW) ematth...@webershandwick.com wrote: You won't be able to save as a MX2004 file from CS4. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Jinks Sent: Thursday, May 20, 2010 9:27 AM To: Flash Coders List Subject: [Flashcoders] Upgrade from MX2004 to CS4 - issues? I'm covering for a colleague and am working on their Flash projects using MX2004, which . However, I just discovered that we have a license for CS4 but that she's stuck with the older version because of 'compatibility' problems. Any idea what these are? She isn't around to ask. Part of the picture is that we have a couple of templates in AS1 - will CS4 meddle with these in anyway? TIA Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Paul Jinks Assistant Development Librarian University of Sheffield Library Tel: [0114 22] 27235 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Line break in dynamic text imported from xml
Thanks Ktu I managed to get this to work by using !CDATA[...]] just as you suggested. I hadn't understood that it needed to go inside each of my xml tags. It's something of a chore, but the quiz is looking a lot better now. Cheers Paul On 19 May 2010 16:38, Ktu ktu_fl...@cataclysmicrewind.com wrote: From what I remember when using xml with html, you need to wrap your html inside of a* ![CDATA[**]]* to get it to render properly. You can put a \r or \n in it as well. On Wed, May 19, 2010 at 10:56 AM, Paul Jinks p...@pauljinks.co.uk wrote: It's been a long time since I've done any coding. I think this is pretty straightforward but it has me beat. Can you help? I'm working on a quiz using AS1 (I think) that reads questions and answers from an xml file. (see below for the script). I'd like to introduce line breaks into the feedback, how do I do this? I've tried using \r but it just displays this as text. Ideally I'd like to display the text as html but so far my efforts to do this have broken the script - any pointers? Here's the action script for the quiz. I hope it makes sense: function QuizItem(question) { this.question=question; this.answers=new Array(); this.feedbacks=new Array(); this.numOfAnswers=0; this.correctAnswer=0; this.getQuestion=function() { return this.question; } this.addAnswer=function(answer, isCorrectAnswer, feedback) { this.answers[this.numOfAnswers]=answer; this.feedbacks[this.numOfAnswers]=feedback; if (isCorrectAnswer) this.correctAnswer=this.numOfAnswers; this.numOfAnswers++; } this.getAnswer=function(answerNumberToGet) { return this.answers[answerNumberToGet]; } this.getFeedback=function(answerNumberToGet) { return this.feedbacks[answerNumberToGet]; } this.getCorrectAnswerNumber=function() { return this.correctAnswer; } this.checkAnswerNumber=function(userAnswerNumber) { if (userAnswerNumber==this.getCorrectAnswerNumber()) { numOfQuestionsAnsweredCorrectly++; } else { numOfQuestionsAnsweredIncorrectly++; } feedback = _root[feedback+parseInt((userAnswerNumber+1))] gotoAndPlay(Feedback); } } function onQuizData(success) { var quizNode=this.firstChild; var quizTitleNode=quizNode.firstChild; title=quizTitleNode.firstChild.nodeValue; var i=0; // items follows title var itemsNode=quizNode.childNodes[1]; while (itemsNode.childNodes[i]) { var itemNode=itemsNode.childNodes[i]; // item consists of question and one or more answer // question always comes before answers (node 0 of item) var questionNode=itemNode.childNodes[0]; quizItems[i]=new QuizItem(questionNode.firstChild.nodeValue); var a=1; // answer follows question var answerNode=itemNode.childNodes[a++]; while (answerNode) { //trace(answerNode); var isCorrectAnswer=false; if (answerNode.attributes.correct==y) isCorrectAnswer=true; //get answer tempAnswer = answerNode.firstChild.nodeValue; //go to next node answerNode=itemNode.childNodes[a++]; //get feedback tempFeedback = answerNode.firstChild.nodeValue; //add answer and feedback to current answer/feedback 'pair' quizItems[i].addAnswer(tempAnswer, isCorrectAnswer, tempFeedback); // goto the next answer answerNode=itemNode.childNodes[a++]; } i++; } gotoAndStop(Start); } var quizItems=new Array(); var myData=new XML(); myData.ignoreWhite=true; myData.onLoad=onQuizData; myData.load(google_quiz.xml); stop(); And this is what the xml file looks like: !DOCTYPE quiz [ !ELEMENT quiz (title, items) !ELEMENT title (#PCDATA) !ELEMENT items (item)+ !ELEMENT item (question, answer, answer+) !ELEMENT question (#PCDATA) !ELEMENT answer (#PCDATA) !ELEMENT feedback (#PCDATA) !ATTLIST answer correct (y) #IMPLIED ] quiz titleMy quiz/title items item questionWhat colour are greenfly/question answerRed/answer feedbackYou chose answer [a]. This is incorrect. The correct answer
RE: [Flashcoders] Upgrade from MX2004 to CS4 - issues?
Yes, AS1 is supported in both CS4 and CS5. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Jinks Sent: Thursday, May 20, 2010 10:41 AM To: Flash Coders List Subject: Re: [Flashcoders] Upgrade from MX2004 to CS4 - issues? Thanks Eric I'm guessing that this won't be a problem, since once we've made the move we won't need to save files for MX2004. Will transitioning to CS4 disrupt the files in anyway e.g. render the code differently - the adobe documentation suggests that AS1 is supported in CS4 - can anyone confirm this? Sorry for being so vague. I'm trying to guess what the problems anticipated might have been. Cheers Paul On 20 May 2010 16:01, Mattheis, Erik (MIN - WSW) ematth...@webershandwick.com wrote: You won't be able to save as a MX2004 file from CS4. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Jinks Sent: Thursday, May 20, 2010 9:27 AM To: Flash Coders List Subject: [Flashcoders] Upgrade from MX2004 to CS4 - issues? I'm covering for a colleague and am working on their Flash projects using MX2004, which . However, I just discovered that we have a license for CS4 but that she's stuck with the older version because of 'compatibility' problems. Any idea what these are? She isn't around to ask. Part of the picture is that we have a couple of templates in AS1 - will CS4 meddle with these in anyway? TIA Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Paul Jinks Assistant Development Librarian University of Sheffield Library Tel: [0114 22] 27235 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Line break in dynamic text imported from xml
Paul Jinks wrote: I managed to get this to work by using !CDATA[...]] just as you suggested. I hadn't understood that it needed to go inside each of my xml tags. Just a clarification--it doesn't need to be inside each of your XML tags. Only the ones that contain text you're going to display, especially if they have HTML tags like b or \n. You don't need to make your nodes CDATA (which, by the way, stands for Character Data--i.e., text). Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Line break in dynamic text imported from xml
and what goes in the CDATA is not parsed by the xml reader. On Thu, May 20, 2010 at 12:20 PM, Kerry Thompson al...@cyberiantiger.bizwrote: Paul Jinks wrote: I managed to get this to work by using !CDATA[...]] just as you suggested. I hadn't understood that it needed to go inside each of my xml tags. Just a clarification--it doesn't need to be inside each of your XML tags. Only the ones that contain text you're going to display, especially if they have HTML tags like b or \n. You don't need to make your nodes CDATA (which, by the way, stands for Character Data--i.e., text). Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Line break in dynamic text imported from xml
I managed to get this to work by using !CDATA[...]] just as you suggested. I hadn't understood that it needed to go inside each of my xml tags. Just a clarification--it doesn't need to be inside each of your XML tags. Only the ones that contain text you're going to display, especially if they have HTML tags like b or \n. Well, to clarify the clarification - you need to use CDATA whenever you have contents of an element that may contain unescaped XML metacharacters: , , ', , . If you don't do this - whether you plan to display the contents or not - and your element contains a metacharacter, the XML parser will be unable to parse the file. Basically, a CDATA block tells the parser to ignore the contents. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Upgrade from MX2004 to CS4 - issues?
Paul Jinks wrote: Thanks Eric I'm guessing that this won't be a problem, since once we've made the move we won't need to save files for MX2004. Will transitioning to CS4 disrupt the files in anyway e.g. render the code differently - the adobe documentation suggests that AS1 is supported in CS4 - can anyone confirm this? There is a minor bug with scenes and frame labels. But it's been fixed in the updated release. And it is kinda hard (maybe impossible) to trip it in as 2 mode. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders