![]() |
![]() |
||||||
|
|||||||
| Tags: component, passing, scrollingtext, value, xml |
![]() |
|
|||
|
Good morning Flex Gurus...:smile;
I just have a simple question. I am trying to pass a value from an ArrayCollection coming from MySQL that was generated into a XML to the ScrollingText Compoment but is not being displayed by the component. However, when pass the value to a mx:Text, the value is actually displayed. The component code is posted below. Code to display the Scrolling text Correct: <comps:ScrollingText id="myScrollingText" text="Welcome to our Office..." fontSize="40" fontStyle="italic" initialize="myScrollingText.start()" color="#0053C4" fontWeight="bold" fontFamily="Arial"/> I successfully implemented a code to access the other parts of the generated XML to be displayed in my applicaton however when I tried to implement the same with the component and pass the value it did not work. Code that is not working: <mx:Repeater id="roomMarqueRepeater" dataProvider="{rest_service.lastResult.scheds.mrq. msg}" > <comps:ScrollingText id="myScrollingText" text="{roomInfoRepeater.currentItem.mrq_msg}" fontSize="40" fontStyle="italic" initialize="myScrollingText.start()" color="#0053C4" fontWeight="bold" fontFamily="Arial"/> </mx:Repeater> ScrollingText.MXML <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="50" horizontalScrollPolicy="off" verticalScrollPolicy="off" creationComplete="init()" fontSize="20" fontFamily="Verdana" color="#2C1FDB"> <mx:Script> <![CDATA[ import mx.controls.Text; private var myTimer:Timer = new Timer(10); [Bindable] public var text:String; public function start():void { myTimer.start(); } private function init():void { myTimer.addEventListener(TimerEvent.TIMER, moveLabel); } private function moveLabel(event:TimerEvent):void { if (scrollingLabel.x < (0-scrollingLabel.width)) { scrollingLabel.x = this.width; } else { scrollingLabel.x --; } } ]]> </mx:Script> <mx:Label id="scrollingLabel" x="{this.width}" text="{text}"/> </mx:Canvas> my XML that is Generated: <scheds> <mrq> <msg><mrq_id>1</mrq_id><mrq_msg>Welcome to our Office!!!</mrq_msg></msg> </mrq> </scheds> Hope someone can help. I tried looking for some parameter passing post but I can't find one that fit my needs. Thanks and good day to all... It really is fun FLEXING... :smile; |
| Sponsored Links |
|
|||
|
Adobe Newsbot hopes that the following resources helps you. NewsBot is experimental and any feedback (reply to this post) on its utility will be appreciated:
Flex - Using Item Renderers: The second component is a Label in which we display the artist name and song title concatenated ..... I have an array collection that populates a datagrid. Link: http://blog.paranoidferret.com/index...tem-renderers/ Peter Ent: Flex 2 Archives: In Flex 1.5 it was pretty common to use an Array as a dataProvider to a List component, such as the DataGrid. That's because in Flex, the Array class Link: http://weblogs.macromedia.com/pent/a...x_2/index.html Peter Ent: Flex Solutions Archives: The UIComponent class is the basis for all visual Flex components .... does not work well for list controls but does perform nicely for a VBox and Repeater. Link: http://weblogs.macromedia.com/pent/a...ons/index.html Disclaimer: This response is generated automatically by the Adobe NewsBot based on Adobe [L=Community Engine]http://community.adobe.com/ion/search.html[/L]. |
|
|||
|
"almond0517" <webforumsuser@macromedia.com> wrote in message news:g957an$j14$1@forums.macromedia.com... > Good morning Flex Gurus...:smile; > > I just have a simple question. I am trying to pass a value from an > ArrayCollection coming from MySQL that was generated into a XML to the > ScrollingText Compoment but is not being displayed by the component. > However, > when pass the value to a mx:Text, the value is actually displayed. The > component code is posted below. > > Code to display the Scrolling text Correct: > <comps:ScrollingText id="myScrollingText" text="Welcome to our Office..." > fontSize="40" > fontStyle="italic" initialize="myScrollingText.start()" > color="#0053C4" fontWeight="bold" fontFamily="Arial"/> > > I successfully implemented a code to access the other parts of the > generated > XML to be displayed in my applicaton however when I tried to implement the > same > with the component and pass the value it did not work. When you say "it did not work", what actually _did_ happen? did you get any errors? Have you set any break points and looked at values? If so, what results did you get? |
|
|||
|
thanks for the reply.
there were no errors actually. I havent tried debugging coz when i use the debug my Flex usually hangs up and says that it cant se the flash player. there is really no errors and will try debugging it however when i run the application the application works fine but the scrolling text doesnt show. Funny thing is if remove it from the repeater and change the text value of the scrolling text to some that is not coming from the XML or any value of a string it actually works. any suggestions thanks in advance for the help... :smile; |
|
|||
|
"almond0517" <webforumsuser@macromedia.com> wrote in message news:g96kq0$83i$1@forums.macromedia.com... > thanks for the reply. > > there were no errors actually. I havent tried debugging coz when i use the > debug my Flex usually hangs up and says that it cant se the flash player. > > there is really no errors and will try debugging it however when i run the > application the application works fine but the scrolling text doesnt show. > Funny thing is if remove it from the repeater and change the text value of > the > scrolling text to some that is not coming from the XML or any value of a > string > it actually works. > > any suggestions thanks in advance for the help... Try <mx:Repeater id="roomMarqueRepeater" dataProvider="{rest_service.lastResult.mrq.msg}" > <comps:ScrollingText id="myScrollingText" text="{roomInfoRepeater.currentItem.mrq_msg}" fontSize="40" fontStyle="italic" initialize="myScrollingText.start()" color="#0053C4" fontWeight="bold" fontFamily="Arial"/> </mx:Repeater> HTH; Amy |
|
|||
|
Good AM.
Just checked your code and noticed that it wont work because of the declaration of the Repeater. If you will check you used the 2 different repeater names. <mx:Repeater id="roomMarqueRepeater" dataProvider="{rest_service.lastResult.mrq.msg}" > <comps:ScrollingText id="myScrollingText" text="{roomInfoRepeater.currentItem.mrq_msg}" fontSize="40" fontStyle="italic" initialize="myScrollingText.start()" color="#0053C4" fontWeight="bold" fontFamily="Arial"/> </mx:Repeater> Also, i already tried this code and still nothing is being displayed in the ScrollingText component, another thing is when i use the repeater code you suggested and use a text not using the ScrollingText component and instead use a Label or text component and then pass the value of the {roomMarqueRepeater.currentItem.mrq_msg} it works and displays the value. Thanks in advance hope someone can point me to the correct way to solve this problemm of ours. :smile; |
|
|||
|
"almond0517" <webforumsuser@macromedia.com> wrote in message news:g97jhd$9r5$1@forums.macromedia.com... > Good AM. > > Just checked your code and noticed that it wont work because of the > declaration of the Repeater. If you will check you used the 2 different > repeater names. I just copied your code. The only thing I changed was I took out the root tag from the dataProvider below, since the XML object already _is_ the root tag. HTH; Amy |
|
|||
|
Did you had it working???
I really don't know why it doesnt display. I tried it again, still doesnt work. Did it work on your side??? Hope someone can suggest us how to fix it. thanks in advance once again. :smile; |
|
|||
|
oh ic, hope someone can point us out to a solution to this problem.
I have tried multiple numbers of way to solve it but still to no avail... hope someone can help us....calling flex gurus.... thanks in advance for the help. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise