Scrolling event: movieclip instead of dynamic text
Hello everybody. I am very very novice to actionscript, so probably my question will sound a little silly.
I am trying to put an arabic text to scroll with a custom scrollbar. So I found a nice video in youtube about doing that with a dynamic text field. It works wonderful for latin characters (left to right and separated letters) but unfortunately not for arabic characters (they don't get connected). Actually, I don't care to use just a movieclip with the text instead of the dynamic text field. But I don't know how to change the actionscript code for the movie clip instead of the dynamic text field.
Here I show you the code for the scrolling text in a dynamic text field (it's a short code), on the stage I got just the dynamic text field (instance name: texto_txt), the scrollBar (a vertical line, instance name: scrollBar_mc) and the scroller itself (a little rectangle, instance name:scrollHandle_mc):
var content:String = "cjeihfirehjfejlkfjkerjfirjfejifjrijwkjfirwjekñlkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllll";
texto_txt.text = content;
texto_txt.wordWrap = true;
var min: Number = scrollHandle_mc.y;
var max: Number = min +(scrollBar_mc.height - scrollHandle_mc.height);
var intervalo: Number = max - min;
var arrastrando: Boolean = false;
var bounds: Rectangle = new Rectangle (scrollHandle_mc.x, scrollHandle_mc.y, 0, scrollBar_mc.height - scrollHandle_mc.height);
scrollHandle_mc.addEventListener (MouseEvent.MOUSE_DOWN, arrastrandoScroll);
stage.addEventListener (MouseEvent.MOUSE_UP, stopIt);
function arrastrandoScroll(mouseEvent:MouseEvent)
scrollHandle_mc.startDrag(false,bounds);
arrastrando = true;
scrollHandle_mc.addEventListener(Event.ENTER_FRAME, progress);
function stopIt(mouseEvent:MouseEvent)
scrollHandle_mc.stopDrag();
arrastrando = false;
function progress(e:Event)
var moverScroll:Number = scrollHandle_mc.y - min;
var percent:Number = moverScroll/intervalo;
if (arrastrando == true)
texto_txt.scrollV = percent * texto_txt.maxScrollV;
What I want to do is clear the dynamic text field and use instead a movieclip (text_mc) that includes already the text, the bounding box would be a mask. How do I change the actionscript? Could anyone help me out?
It isn't really a matter of math, as much as it is logical reasoning, but if you plan to do things with programming, you better plan on getting comfortable with learning math as well. Programming and math go hand-in-hand.
Here's a simplified explanation of what your code needs to do -> If you move the scroller 25% of the total distance it can move, then the movieclip should be moved 25% of the distance it can move (in the oppostie direction).
Your scroller handle can be moved a predefined distance. In your code that value is called "intervalo". See if you can figure out how that value is determined in the 3 lines of code.
var min: Number = scrollHandle_mc.y;
var max: Number = min +(scrollBar_mc.height - scrollHandle_mc.height);
var intervalo: Number = max - min;
Later on in your progress function you can see where the scrollbar handle values com into play again when determining where to place the textfield. But if we change that to be the movieclip, it becomes more like the following...
function progress(e:Event)
var moverScroll:Number = scrollHandle_mc.y - min;
var percent:Number = moverScroll/intervalo;
if (arrastrando == true)
yourMC.y = percent * (yourMCmaxY-yourMCminY) + yourMCMinY;
// where yourMCmaxY-yourMCminY is the mc's movement range
// which is likely to be negative since yMax is likely < yMin for the mc.
Similar Messages
-
RollOver movieClip to display dynamic text
I have no ides how to do this.
It must be easy but I can't seem to get it. I have a movie
clip called A_mc and a dynamic text field called instance name
"Names", when the mouse rolls over the A_mc I want a name assigned
to the A_mc to show up in the Names text field.
It seemed simple enough, I have seen it used in educational
SWF when the mouse rolls over the A_mc the name of that part or
area shows us in the text field.
But I need help HHEELLLPThanks Gibbah
For your help, I don't think I thgink the right way for
Flash, I know it takes time but this seems to be driving me mad.
The code you gave me, that is attached to the A_m (Movie
Clip).
The Dynamic Text called names appears on the swf along with
the A_m symbol but no action
I get and error
The class or interface 'Event' could not be loaded.
CODE
on(rollOver){
A_mc.addEventListener(MouseEvent.MOUSE_OVER,showName);
function showName(e:Event):void {
A_mc.Names.text= "Rob Beckett";
I must be doing something else wrong
Rob -
Adding a progress loader to a dynamic text field / scrollPane
I have a dynamic text field which is loading images from an external html. This text is named scrollPaneImage and is a child of a movieClip called scrollPaneContent. I then load scrollPaneContent into a scroll pane named scrollPane
When the user interacts with my swf different images are loaded into scrollPaneImage. Since some of the images take a few seconds to load, I'd like there to be a progress loader displayed in the scrollpane.
I have tried adding the progress event listner to the dynamic text, the movie clip and the scrollpane and cannot get it to respond or track the loading.
scrollPaneContent.addEventListener(ProgressEvent.PROGRESS,reportProgress);
function reportProgress(e:ProgressEvent):void {
trace(e.bytesLoaded + " loaded out of " + e.bytesTotal);
trace("LOADED");
Can anyone suggest what I might be doing wrong or of another approach?
thanks in advance,
JoshHi KGLAD. Thanks for the response. Yes my code is a little messy. Here I have included everything and tried to do a little cleaning. Is there enough code here for you to get an idea of how/when things are firing?
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.distriqt.gmaps.kml.utils.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.TweenLite;
import flash.geom.Point;
import com.greensock.plugins.*;
TweenPlugin.activate([AutoAlphaPlugin]);
import com.google.maps.controls.NavigationControl;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.OverviewMapControl;
import com.google.maps.overlays.GroundOverlay;
import com.google.maps.overlays.GroundOverlayOptions;
import com.google.maps.LatLng;
import com.google.maps.LatLngBounds;
import com.google.maps.MapMouseEvent;
import com.google.maps.controls.*;
import com.google.maps.overlays.Marker;
import com.google.maps.InfoWindowOptions;
import com.google.maps.overlays.MarkerOptions;
import com.anttikupila.utils.JPGSizeExtractor;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.net.URLLoader;
import fl.controls.UIScrollBar;
import flash.events.Event;
import fl.events.ScrollEvent;
import flash.sampler.NewObjectSample;
[Embed(source="ICONS/PHOTO_BLACK.png")]var photoIcon:Class;
[Embed(source="ICONS/BLOG_BLACK.png")]var blogIcon:Class;
scrollPane
// GMAP PARAMETERS
var map:Map = new Map();
map.key = "map key";
//map.key = "api key";
//define the size of the map extent....
map.sensor = "false";
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
map.addEventListener(MapEvent.MAP_READY, onMapReady);
map.addEventListener(MapEvent.MAP_READY, createmarkers);
map.addEventListener(MapEvent.MAP_READY, createMarkerArrays);
map.addEventListener(MapEvent.MAP_READY, createPhotoPingers);
this.addChild(map);
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
//on map ready params
function onMapReady(event:Event):void
map.setCenter(new LatLng(48,-113.5), 8, MapType.PHYSICAL_MAP_TYPE);
map.enableScrollWheelZoom();
map.disableContinuousZoom();
//Marker options for a photo piece
var photoMarkerOptions:MarkerOptions = new MarkerOptions();
photoMarkerOptions.icon = new photoIcon();
photoMarkerOptions.hasShadow=false;
//Marker options for a blog piece
var blogMarkerOptions:MarkerOptions = new MarkerOptions();
blogMarkerOptions.icon = new photoIcon();
blogMarkerOptions.hasShadow=false;
//load xml tester
var pntloader:URLLoader = new URLLoader();
var pntxml:XML = new XML();
pntloader.addEventListener(Event.COMPLETE, loadpntXML);
pntloader.load(new URLRequest("map_feed.xml"));
// create an array of jpgs to index
var JPGIndexArray:Array = new Array();
//Create array that will be populated with points
var pointsArray:Array = new Array();
//Load the XML
function loadpntXML(e:Event):void {
pntxml=new XML(e.target.data);
pntxml.ignoreWhite = true;
for (var i:int = 0; i< pntxml.row.length(); i++){
pointsArray[i]="mrk"+i;
JPGIndexArray[i]="JPG"+i;
//trace(pntxml);
//Create the markers and add them to the map
function createmarkers(event:Event):void
for (var i:Number = 0; i < pntxml.row.length(); i++) {
var markerOptions:MarkerOptions = new MarkerOptions();
if (pntxml.row[i].TYPE=="PHOTO")
markerOptions.icon = new photoIcon();
markerOptions.tooltip = "Photo";
markerOptions.hasShadow=false;
else if(pntxml.row[i].TYPE=="BLOG")
markerOptions.icon = new blogIcon();
markerOptions.tooltip = "Blog Entry";
markerOptions.hasShadow=false;
else
null
pointsArray[i] = new Marker(new LatLng(pntxml.row[i].LAT,pntxml.row[i].LONG),markerOptions);
markerA.push(pointsArray[i]);
map.addOverlay(pointsArray[i]);
pointsArray[i].addEventListener(MapMouseEvent.CLICK,indexCalledMarkerRecord);
pointsArray[i].addEventListener(MapMouseEvent.CLICK,scrollPanePopulate);
// PING PHOTO DIMENSIONS BEFORE LOADING //
var je : JPGSizeExtractor = new JPGSizeExtractor( );
je.addEventListener( JPGSizeExtractor.PARSE_COMPLETE, jeLoadHandler );
je.addEventListener( JPGSizeExtractor.PARSE_FAILED, jeParseFailed );
function createPhotoPingers(event:Event):void{
for (var k:Number=0; k <pntxml.row.length(); k++){
JPGIndexArray[k]=new JPGSizeExtractor();
JPGIndexArray[k].debug = false;
JPGIndexArray[k].addEventListener(JPGSizeExtractor.PARSE_COMPLETE, jeLoadHandler );
trace("madeit");
pingPhotoUrls();
function pingPhotoUrls():void
for (var i:Number = 0; i < pntxml.row.length(); i++) {
var calledMarkerUrl=pntxml.row[i].URL_OF_CONTENT;
JPGIndexArray[i].extractSize(calledMarkerUrl);
var JPG1=null;
function jeLoadHandler(e:Event) : void {
trace(e.currentTarget.width + "x" + e.currentTarget.height );
imageWidths.push(e.currentTarget.width);
function jeParseFailed( event : Event ) : void {
trace( "Parse failed" );
var imageWidths = new Array;
// FUNCTIONS FOR INDEXING CALLED MARKERS//
//Create blank array for use in indexing
var markerA:Array=[];
//VAR FOR USE IN INDEXING CALLED MARKER
var pointindex=null;
//INDEX CALLED MARKER POINT XML RECORD
function indexCalledMarkerRecord(e:MapMouseEvent):void{
pointindex=genIndexPos(markerA,Marker(e.currentTarget));
//trace(pntxml.row[pointindex].DESC);
//FUNCTION FOR INDEXING CALLED MARKER
function genIndexPos(a:Array,e:Marker):uint{
for(var i:uint=0;i<a.length;i++){
if(a[i]==e){
return i;
return null;
// SCROLLPANE FUNCTIONS //
this.addChild(scrollPane);
scrollPane.setSize(255,300);
scrollPane.x=-200;
scrollPane.y=-200;
scrollPane.alpha=0;
scrollPaneContent.mouseEnabled=false;
spHeader.closeBox.addEventListener(MouseEvent.CLICK, function(eMouseEvent):void
TweenLite.to(scrollPane, .5,{autoAlpha:0,overwrite:true});
spHeader.forDrag.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void
scrollPane.startDrag();
spHeader.forDrag.addEventListener(MouseEvent.MOUSE_UP, function (e:MouseEvent):void
scrollPane.stopDrag();
spHeader.forDrag.buttonMode=true;
spHeader.forDrag.useHandCursor=true;
spHeader.width=300;
scrollPane.source = scrollPaneContent;
scrollPaneContent.scrollPaneText.autoSize='left';
scrollPaneContent.scrollPaneImage.autoSize='center';
scrollPaneContent.scrollPaneImage.autoSize=TextFieldAutoSize.CENTER;
scrollPaneContent.mouseEnabled=false;
scrollPaneContent.scrollPaneText.condenseWhite = true;
// Add listener.
scrollPane.addEventListener(Event.COMPLETE, completeListener);
scrollPaneContent.addEventListener(ProgressEvent.PROGRESS,reportProgress);
function completeListener(event:Event):void {
trace('Scrollpane content loaded');
function reportProgress(e:ProgressEvent):void {
trace(e.bytesLoaded + " loaded out of " + e.bytesTotal);
trace("LOADED");
function scrollPanePopulate(event:Event){
//show scroll pane
scrollPane.x=33;
scrollPane.y=33;
TweenLite.to(scrollPane, .5,{autoAlpha:1,overwrite:true});
TweenLite.to(spHeader, .5,{autoAlpha:1,overwrite:true});
//create the temp variables
var calledMarkerIndex=pntxml.row[pointindex].ID;
var calledMarkerDate=pntxml.row[pointindex].DATE;
var calledMarkerDescription=pntxml.row[pointindex].DESC;
var calledMarkerContent=pntxml.row[pointindex].URL_OF_CONTENT;
var imgWidth=JPGIndexArray[pointindex].width;
var imgHeight=JPGIndexArray[pointindex].height;
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
var imgBoxHeight=scrollPaneContent.scrollPaneImage.height;
var txtHeight=scrollPaneContent.scrollPaneText.height;
var contentHeight=(imgBoxHeight+txtHeight);
scrollPane.setSize(300,(contentHeight+15));
//size the text box
scrollPaneContent.scrollPaneText.width=270;
//if image is wide or tall, scale accordingly and create a string that will be used
if(imgWidth>=imgHeight){
var imgSource:String = "<img src="+"'"+calledMarkerContent+"'"+"width='"+250+"'"+"height='"+150+"'"+"/>";
var calledImgHgh=160;
else
var imgSource:String = "<img src="+"'"+calledMarkerContent+"'"+"width='"+110+"'"+"height='"+167+"'"+"/>";
var calledImgHgh=177;
//fill in the text
scrollPaneContent.scrollPaneImage.htmlText=imgSource;
//scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
//pan the map to the called position
map.panTo(pointsArray[calledMarkerIndex-1].getLatLng())
//add the header to the SP and scale accordingly
scrollPane.addChild(spHeader);
spHeader.x=-1;
spHeader.y=1;
spHeader.width=299;
if (txtHeight>=250){
scrollPane.setSize(300,275);
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription+"<br><br>";
if (txtHeight<=5){
scrollPane.setSize(300,200);
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
if (txtHeight>=5){
scrollPane.setSize(300,275);
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription+"<br><br>";
// CREATE TEMP VARIABLES FOR POSITIONING AND PLACE DYNAMIC TEXT
var scTextY=scrollPaneContent.scrollPaneText.y;
var scImageY=scrollPaneContent.scrollPaneImage.y;
var scTextHeight=scrollPaneContent.scrollPaneText.height;
scrollPaneContent.scrollPaneText.y=scImageY+calledImgHgh;
//update the scrollpane and reset the scrollbar
scrollPane.update();
scrollPane.verticalScrollPosition=(0);
scrollPane.verticalScrollBar.height=270;
scrollPane.verticalScrollBar.x=281;
scrollPane.verticalScrollBar.y=3;
spHeader.alpha=0;
this.addChild(spHeader);
var photoMarkersArray=new Array();
var photoMarkersIndexArray=new Array();
//CREATE ARRAY OF PHOTO MARKERS
function createMarkerArrays(e:Event):void{
for (var j:int=0; j<pntxml.row.(TYPE=="PHOTO").ID.length(); j++){
var tempMarkerIndex=pntxml.row.(TYPE=="PHOTO").ID[j];
var tempMarkerRef="mrk"+tempMarkerIndex;
photoMarkersArray.push(tempMarkerRef);
photoMarkersIndexArray.push(tempMarkerIndex); -
I'm having an issue with an embedded AS2 SWF that spawns a MovieClip containing a dynamic text field populated with ActionScript. When I publish/preview the Captivate movie with externalized animations, the dynamic text renders fine. However, when I do NOT externalize animations, the dynamic text appears garbled.
I'd go ahead and externalize animations in this project, but there are other embedded SWFs in the project that work correctly only when they are not externalized.
Anyone have experience with this or a similar issue?I just had a similar problem and fixed it by embedding the font into the Flash SWF and also embedding uppercase and lower case characters.
Not sure why this was needed since I never had to do that with Captivate 3, but that was the only thing that corrected the problem.
/Michael
Click here to visit the www.captivate4.com blog -
On button rollover Dynamic text and Movieclip appear
Hi guys,
I've got an issue - When one of my buttons is rolled over, I want text and a movieclip to appear. When the button is no longer rolled over, I want the text and movieclip to disappear.
The way that I was going to do this was to have anchor_mc as an anchor, and upon rollover have the movieclip play from inside the anchor (as its at the exact X & Y that its needed at) and dynamic text appear.
Questions:
1) How do I attach mc_textbox to mc_anchor --- OR, how do I set coordinate for just where mc_textbox should show?
2) How do I then make the movieclip disappear if the button is no longer rolled over?
3) Is it not possible for me to merge all of the dynamic text functions into one function, using IF statements? I tried this, but couldn't work it out.
AS3 code is attached below.
import flash.events.MouseEvent;
stop();
line1.addEventListener(MouseEvent.ROLL_OVER, line_in1, false, 0, true);
line1.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line2.addEventListener(MouseEvent.ROLL_OVER, line_in2, false, 0, true);
line2.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line3.addEventListener(MouseEvent.ROLL_OVER, line_in3, false, 0, true);
line3.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line4.addEventListener(MouseEvent.ROLL_OVER, line_in4, false, 0, true);
line4.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line5.addEventListener(MouseEvent.ROLL_OVER, line_in5, false, 0, true);
line5.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line6.addEventListener(MouseEvent.ROLL_OVER, line_in6, false, 0, true);
line6.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line7.addEventListener(MouseEvent.ROLL_OVER, line_in7, false, 0, true);
line7.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line8.addEventListener(MouseEvent.ROLL_OVER, line_in8, false, 0, true);
line8.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
line9.addEventListener(MouseEvent.ROLL_OVER, line_in9, false, 0, true);
line9.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
function line_in1(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in2(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in3(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in4(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in5(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in6(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in7(e:MouseEvent):void
line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n And testing a new line";
function line_in8(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_in9(e:MouseEvent):void
line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
function line_out(e:MouseEvent):void
line_output.text = "";
var mc= new mc_empty(); addChild(mc);It isn't relly clear to me what you have versus what you want, so these answers may be equally unclear to you.
1. One way to join them together is to maually place one inside the other while authoring the file. Another way is to use addChild to add the text mc to the anchor... mc_anchor.addChild(mc_textbox); To control where the text mc appears you can set its x and y properties.using actionscript... mc_textbox.x = 0;
2. To make the movieclip disappear you can set its visible property to false... mc_anchor.visible = false;
3. You can probably reduce that code substantially, though it partly depends on what variations there are really going to be in the text that displays for each rollover. For now, I'll assume the text will be entirely different for each...
for(var i:uint=1; i<10; i++){
this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
function line_in(e:MouseEvent):void {
var lineTarget:MovieClip = MovieClip(e:currentTarget);
// could use a switch instead of the if's in series if you know what a switch is
if(lineTarget == line1){
// do things for line1
} else if(lineTarget == line2){
// do things for line2
) else if.... etc -
Scrolling text / Dynamic text Box
Hi guys,
Hopefully someone can help me. I am quite new to flash and
scripts so excuse my stupidity..!!! I am creating a media player
(CS3), and have almost finished it except on small thing that is
driving me round the twist.
I have a few dynamic text boxes that take info from id3 tag
of the mp3 file and I want to make the info inside the boxes scroll
as ideally some of the information will be longer that the text
box.
The code to populate the boxes is:
function id3Handler(evt:Event):void {
songInfo.text = song.id3.artist;
songName.text = song.id3.songName;
album.text = song.id3.album;
I have set the boxes to be scrollable but nothing happens,
hopefully this will be simple for someone to me.
Thanks in advance.Just bumping this back up. I'd really like to figure this one
out -
EDGE and HTML dynamic text in a "box" with scroll bar
I'm new to EDGE, a win7pro master collection cs5.5 suite owner. I'm mainly in the Film/Video post production field (mostly AE, PPro, Pshop, IA) but have been branching into web design the last couple of years. I use Dreamweaver, Fireworks, Flash. While I'm a expert user with all the Film/video apps, I would say I only have intermediate ability with the web apps. While I understand a lot of programing logic bulding blocks I'm not a coder.
So since we're told "flash is dead", my interest in Edge is to try to do some of the things that I can currently do in flash in EDGE. I was excited when Edge first came out but lost interest when it became obvious that Adobe was not going to offer Edge and Muse to "suite owners" but only in their force feeding of the "Cloud". Better known as the "golden goose" for adobe stockholders and a never ending perpetual hole in the pocket for users. Anyway....
I spent the last couple of days doing some of the tuts and messing with the UI. It's matured a lot since I was here last.
I've been working on a flash site for a sports team where one of the pages is a player profile page where college recuriters and other interested parties can view recuriting relavent info/stats about players. This is how it works. While on the "Team" page a users clicks on a button labled "Player Profiles" . (Animation) A "page" flies in and unfurls from the upper right corner (3d page flips effect created in AE played by flash as a frame SEQ). Once it lands filling most of the center of the screen there is a bright flash. As the brightness fades we see the "page" is a bordered box with a BG image of a ball field(End). (Animation) from behind the border in fly small pictures (player head shots with name and jersey number). They stream in and form a circle like a wagon train and the team logo zooms up from infinity to the center of the circle(End). As the user mouses over a player's pic it zooms up a little and gets brighter (like mouseover image nav thumbs for a image slider). If the user clicks on a player's head shot it flips over and scales up to become a text box with a scrollbar. The content of the box is a mix of images, static and dynamic text fields populated from data in an "player info data base" XML file, and some hyperlinks. It's all kept updated dynamicaly with current stats, info and images from the XML file. There is also a "PDF" button that allows the user to open/save/print a PDF of the player's profile (the PDF's are static files for now but the choice of which pdf to retrive is dynamicaly supplied via the XML file.
So.... Is Edge now able to do something like this? Would it need to be a collection of small animations? could these be "assembled" and connected as an asset in dreamweaver ?
I thought I would approach this from the end (ie click on an image and display a box with dynamic TEXT fileds. ) since that is the most important part, ie displaying the dynamicaly updated profile info. Sooooo....
Can Edge display a scrolling text box with Images, static text, and html dynamic text in it??
JoelThe code is in composition ready. Click the filled {}
-
Using loadVariables() to populate a Dynamic Text in a MovieClip
Hello everyone,
I am trying to populate a Dynamic Text with data from a
remote database. I have no problem populating the Dynamic Text with
the data from the remote database if the Dynamic Text is placed in
the main timeline using the following code.
loadVariables ("php/attorney.php", "");
Once I move the Dynamic Text into a Movie Clip with instance
name of “MC_But_1” I am only able to populate the
Dynamic Text if I place the above code in the movie clip. Since it
is going to take sometimes for the data to be transferred from the
remote database I rather to do this on the main timeline before the
MC_But_1 is shown. I have used the following code but for some
reason it is not working.
loadVariables ("php/attorney.php", _root.MC_But_1);
Can someone be kind enough to tell me where I am going wrong?
Thank you very much and have a great day.
Khoramdin> Since it is going to take sometimes for the data to be
> transferred from the remote database
That is one of the best arguments for abandoning
loadVariables() in
favor of LoadVars(). Check that out in the manual. It's
better because
there are events that get triggered when a data transfer has
completed
and you can write an event handler script to deal with server
responses.
Christian Scholz-Flöter -
Auto scrolling dynamic text field(news ticker)
> This message is in MIME format. Since your mail reader
does not understand
this format, some or all of this message may not be legible.
--B_3272625483_2679871
Content-type: text/plain;
charset="US-ASCII"
Content-transfer-encoding: 7bit
Does anyone know how to make a scrollable dynamic text field
scroll on its
own and also with user interaction?
Thanks in advance for your help.
Bill
--B_3272625483_2679871
Content-type: text/html;
charset="US-ASCII"
Content-transfer-encoding: quoted-printable
<HTML>
<HEAD>
<TITLE>Auto scrolling dynamic text field(news
ticker)</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN
STYLE=3D'font-size:12.0px'>Does =
anyone know how to make a scrollable dynamic text field
scroll on its own an=
d also with user interaction?<BR>
<BR>
Thanks in advance for your help.<BR>
<BR>
Bill</SPAN></FONT>
</BODY>
</HTML>
--B_3272625483_2679871--I found this:
http://www.kirupa.com/developer/mx/dynamic_scroller.htm
I copied the actual scroller and put it in my .fla and it
worked! Now if I can only figure out links in XML... -
I have a dynamic text field that I want to add a UIScrollBar
to. The dynamic text field has an rssreader attatched to it so it
is reading from an xml file on the same server. When I attatch it
and go to preview my movie, it doesn't work. There is just a white
rectangle on the right side of the box with no arrows or thumb box.
I can drag my mouse over the text and highlight everything, but I
cannot get the scrollbar to work at all. I've checked to make sure
that my scrollbar is connected to my text instance. Is there
something special about dynamic text that I don't know about? Will
it only work at runtime?I found this:
http://www.kirupa.com/developer/mx/dynamic_scroller.htm
I copied the actual scroller and put it in my .fla and it
worked! Now if I can only figure out links in XML... -
Dynamic Text Feild with Dynamic Scroll Bar
I have a Dynamic Text Feild with a dynamic Scroll bar.
It loads a simple ASCI text file with some html formating.
but I still can not manage to get the text to format.
The biggest problem with the format is a big space between
paragraphs.
I am not sure why but I think the Frame must need a var to
render to html.
Can anybody help please?My text had the following, similar but no parsing string.
I guess
yourstring.split("\n\r").join("\r").split("\r\n").join("\r");
takes out the carrage returns or <br>?
I notice the one I had just say's String.
I assume that would be the text that is the string?
Thank you for sharing your knowledge of this.
var my_lv:LoadVars = new LoadVars();
my_lv.onData = function(src:String) {
if (src != undefined) {
myTxtFeild.text = src;
} else {
myTxtFile.text = "Error loading text.";
my_lv.load("CadnetPage1_html.txt"); -
Dynamic text is inside movieClip
I am working on flash & AS file, in flash file (main.fla) dynamic text is inside that movieClip (myButton) .I will like to send some text to that particular dynamic text field inside the movieClip (myButton) from AS file
as file code is
var myButton:Button;
var myText:text;
myButton.myText.text="Custom Msg";
I import .as file in flash but it is not showing can anybody help me?This is working fine but my problem is that, in my another application I am importing the class from as file in that as file I have one loop
if(errorCode == 0){
trace("welcome ");
mc.myText.text="Custom Msg";
}else{
trace("Error loging in to Server Error Code : "+ errorCode)
It will trace message properly
my problem is that I will like to put "Custom Msg" in dynamic text which is in MovieClip (mc) of fla file, how could I go wtih this ?
If I include same as file in flash It will shows as error
1037: Packages cannot be nested. What the solution for this ? -
How to link one scroll bar with two dynamic text boxes.
How to link one scroll bar with two dynamic text boxes.
If i move scroll bar in one text box,automatically text will
be moved in another text box.But scroll bar is not visible.
Can you please help me.
Thanks in advance.See the following article:
JavaScript - setFocus Method for tabbing to next form field
And see if iOS can even handle the sample form.
iOS and android devices are not a powerful as your desktop of laptop computer and have limited support for JavaScript within PDF forms. This limitation for specific apps ranges from none to quite a bit but not all JavaScript. -
Linking a class to a dynamic text field to load XML data.
Hi,
I'm quite new to ActionScript and would be grateful for any help here.
I want to load text into a dynamic text field (called 'about_tab') using a class depending on the language selected (by clicking on a flag icon) by the user.
I managed to get this to work when the ActionScript was written directly in the timeline, but am having problems with doing the same thing via a class.
This is my class file:
package
import flash.display.SimpleButton;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
public class ChangeLang extends SimpleButton
public function ChangeLang()
addEventListener(MouseEvent.CLICK, switchLang);
trace("ChangeLang class working");
public function switchLang(event:MouseEvent):void
var lang = event.target.name;
var req:URLRequest = new URLRequest("languages/"+lang+".xml");
var loader:URLLoader = new URLLoader();
var substance:XML;
function xmlLoaded(event:Event):void
trace("function xmlLoaded is running");
substance = new XML(loader.data);
about_tab.text = substance.about_lbl;
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loader.load(req);
Here's one of my XML files (the other is the same except "About" is written in German):
<substance>
<about_lbl>About</about_lbl>
</substance>
When I run it, it returns my trace statements that the class ChangeLang and the function xmlLoaded are running, but no text appears in the dynamic text field (I should/want to see the word 'About'). I get this error message:
1120: Access of undefined property about_tab
The problem, I'm guessing, is in the part in red in my code. I think I need to target the text field in the display list by creating a reference to it. If so, could someonw point out how I do this, or perhaps a tutorial that would help. I've tried adding the word stage (i.e.,stage.about_tab.text = substance.about_lbl; ) but it still doesn't connect. I guess there's something really simple I'm missing, so I apologize if this comes across as a stupid question
Thanks for any help.Hello flashrocket!
I'm also new to AS3 and I've just started using external classes and I think I know what you should do to put your code to work.
Instead of using the text field you created inside your flash file, why don't you use the "TextField" class to create an instance of this object? It's the exact same thing as when you create and instantiate a new text field inside Flash.
First, import flash.text.*; (includes classes like TextField, TextFieldAutoSize, TextFormat, TextFormatAlign, etc)
Than you just have to create a var like
public var about_tab : TextField;
or
public var about_tab : TextField = new TextField();
then, to adjust the properties of this tab you use dotsyntax as if it where on your stage like:
about_tab.x = 50; about_tab.alpha = .5; etc...
you can even create a function to "config your textField"
private function createAndConfigTextField() : void {
about_tab = new TextField(); //you only need this line if you
// only typed something like "public var about_tab:TextField;
// if instead you used "public var about_tab:TextField = new TextField(); outside
// this function, just skip this first line because you already have an instance of
// text field named "about_tab"...
about_tab.autoSize = TextFieldAutoSize.CENTER;
about_tab.background = true;
about_tab.border = true;
var aboutTextFormat : TextFormat = new TextFormat();
format.font = "Arial";
format.color = 0x000000;
format.size = 11;
format.bold = true;
format.align = TextFormatAlign.CENTER;
about_tab.defaultTextFormat = aboutTextFormat;
addChild(about_tab);
This is just an example of what you can do... I hope you get it... let me know if you have any doubt... -
Adding Scrollbar and buttons to Dynamic Text
Hello,
I am trying to connect dynamic text to scrollbar and buttons. I did tutorial and Lynda.com and practically pasted the code in with my file names and for some reason it does not work. It says I have a "Access of Undefined Property mask_mc" Did I need to create a variable for this? I didn't in the tutorial.
Right now I have the dynamic text loading successfuly in 2 different places and I wantd to add the scrollbar. I put the variables on frame 1 code and then I put the actually load code on the frame where it is needed.
Any suggestions?
Thanks! Sandra
HERE IS CODE FOR FRAME 1:
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest;
var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = philText_mc.y;
var easing:Number = 5;
var scrollAmt:Number = 15;
var scrollDirection:Number = 0;
HERE IS CODE FOR FRAME WHERE TEXT LOADS:
textReq = new URLRequest("text_philosophy.txt");
function philosophyTextLoaded(event:Event):void {
philText_mc.philosophy_txt.text = textLoader.data;
minScroll = philText_mc.y;
maxScroll = minScroll - philText_mc.height + mask_mc.height;
function dragScroller(event:MouseEvent):void
var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;
scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
stage.removeEventListener(Event.ENTER_FRAME, scrollText);
function stopDragging(event:MouseEvent):void
scroller_mc.stopDrag();
function setScrollPercent(event:Event):void
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
scrollPercent = 0;
else if(scrollPercent > 1)
scrollPercent = 1;
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
philText_mc.y -= (philText_mc.y - targetScroll) / easing;
function scrollUp(event:MouseEvent):void
setDirection(scrollAmt);
function scrollDown(event:MouseEvent):void
setDirection(-scrollAmt);
function setDirection(dir:Number):void
scrollDirection = dir;
stage.addEventListener(Event.ENTER_FRAME, scrollText);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
function scrollText(event:Event):void
targetScroll += scrollDirection;
philText_mc.y -= (philText_mc.y - targetScroll) / easing;
if(philText_mc.y > minScroll)
philText_mc.y = minScroll;
targetScroll = minScroll;
else if(philText_mc.y < maxScroll)
philText_mc.y = maxScroll;
targetScroll = maxScroll;
scrollPercent = (philText_mc.y - minScroll) / (maxScroll - minScroll);
scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
function stopScrolling(event:MouseEvent):void
scrollDirection = 0;
textLoader.load(textReq);
scroller_mc.buttonMode = true;
philText_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener(Event.COMPLETE, philosophyTextLoaded);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown);Hello again,
Maybe I am asking this question wrong. Instead of making you try and figure out what's going on in my file what I really need to know is how you would take this code I am attaching and make it happen on another frame besides frame 1 and it doesn't appear on frame 1. I think this may help me understand a little better.
Also another way I was thinking to get around this would be to pull in an external swf into the spot where I want this text to go because I can make the scrollbars and external text work when it is the only thing going on in the movie. Would this be a bad way to set this up? and also SInce it is an external movie would I have maintimeline issues with mouse/scroller control?
thanks! sandra
Here is working code:
var textLoader:URLLoader = new URLLoader();
var textFile:URLRequest = new URLRequest("text/external.txt");
var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = text_mc.y;
var easing:Number = 5;
var scrollAmt:Number = 15;
var scrollDirection:Number = 0;
function textLoaded(event:Event):void
text_mc.external_txt.text = textLoader.data;
minScroll = text_mc.y;
maxScroll = minScroll - text_mc.height + mask_mc.height;
function dragScroller(event:MouseEvent):void
var dragX:Number = line_mc.x - scroller_mc.width/2 + 1;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;
scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
stage.removeEventListener(Event.ENTER_FRAME, scrollText);
function stopDragging(event:MouseEvent):void
scroller_mc.stopDrag();
function setScrollPercent(event:Event):void
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
scrollPercent = 0;
else if(scrollPercent > 1)
scrollPercent = 1;
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
text_mc.y -= (text_mc.y - targetScroll) / easing;
function scrollUp(event:MouseEvent):void
setDirection(scrollAmt);
function scrollDown(event:MouseEvent):void
setDirection(-scrollAmt);
function setDirection(dir:Number):void
scrollDirection = dir;
stage.addEventListener(Event.ENTER_FRAME, scrollText);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
function scrollText(event:Event):void
targetScroll += scrollDirection;
text_mc.y -= (text_mc.y - targetScroll) / easing;
if(text_mc.y > minScroll)
text_mc.y = minScroll;
targetScroll = minScroll;
else if(text_mc.y < maxScroll)
text_mc.y = maxScroll;
targetScroll = maxScroll;
scrollPercent = (text_mc.y - minScroll) / (maxScroll - minScroll);
scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
function stopScrolling(event:MouseEvent):void
scrollDirection = 0;
textLoader.load(textFile);
scroller_mc.buttonMode = true;
text_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown);
Maybe you are looking for
-
Data pump error ORA-39065, status undefined after restart
Hi members, The data pump full import job hung, continue client also hung, all of a sudden the window exited. ;;; Import> status ;;; Import> help ;;; Import> status ;;; Import> continue_client ORA-39065: unexpected master process exception in RECEIVE
-
Hi, I have a file in c:\dev\core\CSF\csf\data\test.txt. My current directory is c:\dev\core\CSF\csf\build From my current working directory howdo i access test.txt using relative path. My code from is as follows Object.setKeystore("file://../data/tes
-
Re: latest product-specific patches for R12.1.3
Hi , We want the latest product-specific patches for R12.1.3 Regards .
-
Insert 700Mb Cd and need 2 of them to Burn 75.8Mb of info.
I am wondering why when ever i insert a cd that has 700Mb of open space and want to burn 75Mb of something on it it tells me i need another disc....it is a waste. Thanks for your help, Ryan
-
Off Center Printing on 5 x 8 Invitation​s
HP Laserjet 1320n Q5928A Windows 7, 32 bit MS Word 2007 Using the Manual Tray to feed invitations the print is off the left edge, centerd on the left margin rather than the page center. Appears correctly in the print preview. Orientation, scaling and