Iterate through all dynamic text variables
Hello,
I'd like to be able to iterate through all of the dynamic
text variables in my flash movie, and I'd like it so that if I add
new text to this movie, it will show up in the iteration.
Essentially, I want to do something like this:
for (i in _root) {
trace(i);
While this seems to print out all the variables in root, it
prints more than just the dynamic text variables, and also doesn't
iterate down through various objects to find the dynamic text
variable.
Is there any way I can accomplish this in action script?
Thanks!
Great! That code helps me a lot.
There are still two weird issues.
1) the test for tl[obj].text seems to always turn out to be
false. However, if I trace the value of text, I'll see the text.
Example:
trace(tl[obj].text); // This will display the value in the
text field
if (tl[obj].text) // This is always returning false.
Any ideas?
The 2nd issue might be more difficult - some of my text
objects don't appear until later in the movie (i.e. frame 10). It
sort of looks like this looping doesn't see objects that appear in
the future. Do I need to advance the frame 1 by 1 and repeat this
looping process until the text appears? Maybe instead I can always
have the text in the first frame, but have it be invisible or
something?
Similar Messages
-
Iterate through all the records in a table using Java API
Hi All,
What is the easiest way to iterate through all the records in a given table using Java API? I cannot find any methods that will return all records in a table and the only way I can use is to perform a free form search with a condition that is always true. The code works but is pretty ugly. Is there an alternative to this approach?
Thanks!
KennyHi Kenny,
You can construct a new Search object with your table's code name, a new ResultSetDefinition object for your table and just execute this search using the GetResultSet method of CatalogData.
Please look at the following code:
Search search = new Search(<code name of your table>);
ResultSetDefinition rsd = new ResultSetDefinition(<code name of your table>);
rsd.AddField<code name of a field>);
rsd.AddField(<code name of a field>);
String sortField = <code name of your sort field>;
boolean sortAscending = true;
int page = 0; //page number
A2iResultSet rs = <your CatalogData object>.GetResultSet(search, rsd, sortField, sortAscending, page);
for (int i = 0; i < rs.GetRecordCount(); i++)
Value fieldValue = rs.GetValueAt(i, <code name of a field>);
Hope this helps,
Nir
PS - I really recommend you to start using the new API, as it is much more efficient and straight-forward. -
Hi,
We have a container which contains *1 million* documents, each of which has size 5K. Container type is wholedocument. We need to iterate through all document regualrly using container.getAllDocuments(containerTxn, DBXML_LAZY_DOCS | DBXML_NO_INDEX_NODES). For each document, we will perform a xpath query in xml document in memory.
The problem here is about whether we should use transaction. If transaction is used, getAllDocuments will report "Lock table is out of available lock entries" error when it scan about 9383 ducuments. Here are lock setting:
envp->set_lk_max_lockers(6000);
envp->set_lk_max_locks(6000);
envp->set_lk_max_objects(8000);
We have 1 million documents, it is impossible to set lock object to 1 million.
My questions:
(1) Is this normal? If so, why performing a dbxml query on the container doesn't cause such an error. I believe dbxml query has to iterate all of documents too.
(2) Is it possible to use a seek position for getAllDocuments? Thus we can commit transaction every iterating 1000 documents, and then continue the iteration from the last seek position.
(3) if we don't use transaction to call getAllDocuments, what possible problems will happen? Other threads are using transaction to read/update the documents.
Thanks.
-YuanYuan,
The quickest thing to try is to add the flag DB_READ_COMMITTED to getAllDocuments(). That may reduce the number of locks you need. While you may not be able to set the various lock parameters to 1 million, you should set them much larger than you have now (e.g. 50k - 100k) for this sort of operation.
Not using transactions at all can lead to inconsistent data mostly related to index consistency with document content. Depending on the nature of your updates it may be safe. You could get stray exceptions but nothing should crash. E.g. if you are only adding/removing documents you are probably safe without transactions; although you might iterate to a document that's been removed so you'll see an exception which would have to be ignored. I'm not 100% certain this will work well but if you can test it in a high-update environment and see no issues that will tell you. The read side will not interfere with the updates.
As for "seeking" if you look under the covers getAllDocuments() is really just a wrapper for an index lookup on the name index. The XmlIndexLookup API is quite flexible in terms of returning ranges. If you want to look into returning ranges of documents, do this:
1. look at the code in XmlContainer.cpp in the function "getDocs()". It uses XmlIndexLookup to perform the operation.
2. look at the XmlIndexLookup API to figure out how to turn the lookup into a range lookup vs looking up ALL items in the index
Using XmlIndexLookup and tracking the name of your last-used document you can easily ask for all documents "higher" than that one. Further, if you know how your documents are named lexicographically you can give it a maximum as well if you wanted, but given that you can set your XmlQueryContext to be lazy you can simply iterate N times to get the next N documents without paying a penalty retrieving any documents you don't need.
For the sort of thing you are doing I highly recommend using XmlIndexLookup directly (with or without transactions) to get the flexibility you need. XmlContainer::getAllDocuments() is merely a "convenience" layer on that class.
Regards,
George -
Hi,
I'm making a batch processing action and I really need a script that iterates through all open documents, finds the one with the biggest image size and then iterates one more time to change the rest of the documents to the same image size dimensions. At the end all documents must share identical image size. I'll really appreciate if someone can put a quick script for doing this. Thank you !I think should do…
#target photoshop
if (documents.length > 1) {
var smallest = 1000000; // Set beyond any size you may be expecting this should do?
for (var a = 0; a < documents.length; a++) {
smallest = Math.min(smallest,documents[a].width.as('px'));
for (var b = 0; b < documents.length; b++) {
if (documents[b].width.as('px') != smallest) {
app.activeDocument = documents[b];
var newWidth = new UnitValue(smallest, 'px');
documents[b].resizeImage(newWidth,undefined,undefined,ResampleMethod.BICUBICSMOOTHER);
}else{
alert("NOT enough docs to resize?"); -
Can I embed fonts of all Dynamic Text objects in a Flash file?
Hi there!
I'm fairly new to Flash, so please bear with me.
I have created a Flash file which will act as our company's standard presentation / portfolio of all previous projects. I've pretty much got it running the way I want, but I've just tried it on a few different computers and realised that the fonts aren't embedded. I've used our corporate font so it needs to look right. Having read the following documentation (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000893.html) I now understand how to embed fonts for one dynamic text object at a time. However, I have a lot of different dynamic text objects in the file and I would dearly love to embed them all in one step! The same embedding options can be applied to just about all objects, as they're all the same size and font.
I hope someone can help me. If you are able to help please spell things out in simple steps!! I am aware that I probably haven't yet grasped a number of the basics of Flash.
Thanks in advance,
StuartStatic text doesn't need to be embeded. So I'm not sure what the problem you are having is. The page you linked to is for making an embedded font in your library that can then be exported for actionscript and used by code and style sheets. If you are following the instructions on the page you liked to you only need to do that once. Which shouldn't be too hard.
That is usually a different problem that having a bunch of different authortime created textfields that need to have characters embedded.
As far as I know your only hope to change a bunch of authortime/library items is using JSFL. So even if the thing I pointed to isn't exactly what you need you could keep googling a bit or use that as a template.
JSFL files are just text files so open it in note pad. Look for the line:
if(it[i].itemType == "movie clip")
and change it to this:
if(it[i].itemType == "movie clip" || it[i].itemType=="button")
Now it does buttons. You give up too easy. -
All dynamic text links going to same link even though URLs differ
Hi,
I just made a flash news scroller where the news headlines are dynamic text and have different urls provided in the link section. But when I click on any of them, they all go to the first link only. Am I supposed to set something here to stop it from doing so?
Any help appreciated.Ok, I figured out why all the links are going to the same page. Well all the other links are under the first headline, which I am making transparent for the others to appear, but not removing from the stage. Hence even though the first headline is not visible, it is still the top link on the screen, causing everything to go there.
Any suggestions on how I can make it appear below the newly visible headline?? They are all arranged one below the other. -
I have a dynamic text box call "color.txt" at the root and
two Movie clip buttons one called Red and one called Yellow.
When I press the button the name of the button is passed to
the text box. When I press the second button the
name is not replaced. Do I have to create a seperate function
to do this or is there another way?
Thanks,
_root.red.onPress = function(){
_root.colorTxt.text = "Red";
_root.yellow.onPress = function(){
_root.colorTxt.text = "Yellow";
}I got it working like this.
var colors:Array = ["red", "yellow"];
var currentColor:Number;
function changeButton(newColor:Number) {
currentColor = newColor;
_root.colorTxt.text = updateText();
_root.red.onPress = function(){
changeButton(0);
_root.yellow.onPress = function(){
changeButton(1);
function updateText():String {
var newText:String;
newText = colors[currentColor];
return newText;
} -
Loading swf file with dynamic text
For a website I'm creating I'm going to have a main swf file
that loads individual swf files for each page. Each page's swf file
loads in external text files through dynamic text boxes so i can
edit the website easily. To load the swf files into the main swf
file I'm using the loader component. Everything works fine except
thedynamic text boxes of the swf files that are nestled in the main
one do not load properly. Instead, in each text box i get a message
similar to this:
_level0.NewsLoader.contentHolder.News1
NewsLoader is the instance of the loader component, and News1
is a variable called in through a dynamic text field from the html
document entitled News1.html. The individual news swf file loads
the text properly, but when the news swf file is loaded into the
main swf file the text is replaced with the message above.
Any suggestions?the problem might be due to the changed references if you
load the movie into another one.
is NewsLoader a MovieClip instance inside the main movie or
inside the mc that is loaded into the main movie?
If it resides inside the exteranly loaded movie, you will
either need to use the lockroot attribute or use a relative
reference to the News1 variable.
Since the _level0 always points to the _root timeline (the
one of the outer most movieclip) _level0 used in the external mc is
different once the external movieclip is loaded into another movie.
I suggest only using relative references, makes live much
easier. -
Dynamic text box, HTML Text with Image
Hello Everyone,
I am using Flash version 8. I have used the text tool and
created a dynamic text box and have attached the UIScrollBar
component to it. This text box is configured to allow the use of
html text to be inputted to it. I have code that reads a file which
contains a list of text files that I then read and place them into
the text box. The user can use the scroll bar to scroll through all
the text.
I have created an image that is a picture of the tab portion
of a file folder. On the tab I have place some text. This was all
done in Photoshop. This tab image is used to separate the different
stories in the text box. The image is save as a jpeg file
Everything you have just read works with out any problems.
Now for the problem!
This image is only 20 pixels tall and the text is not very
readable. As we all know the HTML tags are very limited in Flash 8.
Ideally I would like to put the text and image in to the text
box as I would normally do. Then place text on top of the image and
have it all scroll properly with in the text box.
I have taken the tab image and converted it in to a graph
symbol and then put the text on top of the image. This looks good;
however I don’t know how (or if it is even possible) to place
the graphic symbol in to the text box at the correct place within
the text.
Does anyone have ideas on what may work? Remember that the
image I am working with is only 20 pixels tall which is why the
text quality on the image is so poor.
Thank you all for any help you may provide,
SteveYes Tim I am using the <img> tag and I know that I
can’t place text over the image. I have set the height and
width to be the exact size of the image. However When you go to the
webpage it will open the movie to the maximum size based on the
resolution of your display; however I do maintain the aspect ratio
of the movie. For testing I did set a fix size to the size of the
movie. Sometimes the fix size (1000x750) looks better and sometimes
a larger size (example 1280x1024). I believe that the main problem
is the fact the size of the image is 670 pixels wide by 25 pixels
high and of the 25 pixels the text is only 18 pixels tall. In
Photoshop this makes it about a 1.75 point font. As you can see the
real problem is that I don’t have enough pixels to make up
the text. This is why I am looking for an alterative way to create
the text.
I tried importing the image into flash as a graphic symbol
and then using the text tool to create the text. The results looked
real sharp, the text was nice and crisp (just what I wanted). The
problem is that I could not find a way to place the graphic symbol
into the dynamic text area like id did using the <img> tag.
This symbol needs to scroll as you scroll the text in the text
area.
This is why I am asking for help. I am looking for some ideas
that may work.
Thank you,
Steve -
Iterate through selected characters
Hi guys and girls!
Has anybody a code snippet to show me how to iterate through the selected text (not the frame!, not the words, only the selected chars) and make any change on the characterAttributes (size, color, etc.)?
Deeper into it:
In the property "app.activeDocument.selection" usually the selected objects are stored as an array. Now when I select characters in a textframe (or TextPath, whatever) there is a [Textrange] in it.
I already tried some combinations like this snippet underneath but I still get errors, that selectedChars[i] is undefined.
FYI: I'm on Illustrator CS4, Mac OS X, Javascript
var selectedChars = app.activeDocument.selection.characters;
for (i = 0; i < selectedChars.length; i++ ){
selectedChars[i].characterAttributes.fillColor = myNewCMYKColor;
I hope I have gathered all relevant information. If not, please do not kill me and just ask back
So has anybody a smart hint for me?
Thanks a lot in advance!Here's a Change Size script that I found in my collection that somebody posted severat years ago. I'm sorry I don't remember who it was to give proper credit.
#target illustrator
// change size of paragraph text
//$.bp();
ChangeSize();
function ChangeSize()
selectedItems = selection;
// check to make sure something is selected.
if (selectedItems.length == 0)
alert("Nothing is selected");
return;
endIndex = selectedItems.length;
for (index = 0; index < endIndex; index++)
pageObject = selectedItems[index];
pageItemType = pageObject.typename;
if (pageItemType == "TextFrame")
// get the paragraphs from the selection.
theTextRange = pageObject.textRange;
paraTextRange = theTextRange.paragraphs;
numParagraphs = paraTextRange.length;
for (i = 0 ; i < numParagraphs ; i++)
aParagraph = paraTextRange[i];
charTextRange = aParagraph.characters;
charCount = charTextRange.length;
if (charCount > 1)
end = charCount;
fontSizeChanger = 14/end;
currentFontSize = 18;
for (j = 0 ; j < end; j++)
theChar = charTextRange[j];
theChar.size = currentFontSize;
currentFontSize = currentFontSize - fontSizeChanger;
and here's the output.
You should be able to go from there. -
Iterate Through Lists Instead of Document Libraries, Or both
System Info: SharePoint 2010 Enterprise w DEC 2013 CU. 2 WFEs (load balanced), App Server, SSRS Server, Dedicated CA Server (All running Win 2k8 R2).
Background:I have a large (5,000 user) application that is completely customized on top of SP2010. I am the admin, and have been on the team for many years. Previously, we had a development team,
but client has scaled costs back, and now its just me on the technical side. We have a Web app that houses multiple Site Collections, and each site collection has various subsites.
My Problem: We have increased the LVT to 10k items (system has plenty of HP, although we do see performance degradation). Each subsite in the Site Collection holds data specific to an organization
wtihin the Line of Business. There are two lists that frequently approach the 10k mark, and we have mitigation steps in place (essentially, we just create a new SubSite for them once they reach 10k). What I need is a single script that will traverse ALL subsites
and return a count of their lists, perhaps I can work a couple of if statements in there to have specific data written to a SP List (if count is greater than 5000), and other wise everything gets written to the output file.
I am trying to iterate through all lists and return a count of folders + items ... The script below works just fine, but it goes through Document Libraries only (per the baseType eq tag).
I've tried changing baseType from DocumentLibrary to GenericList, but I continually get an error.
I've also removed the where baseType = DocLib clause completely, and this has the desired results (all lists and doclibs are listed), except the 'WebUrl' field in the csv output is blank.
Any thoughts on how I can make a small tweak to this script to get my desired results?
Start-SPAssignment -Global
$OutputFile ="D:\folder\DocCount3.csv"
$results = @()
$webApps = Get-SPWebApplication http://WebAppURL
foreach($webApp in $webApps)
foreach($siteColl in $webApp.Sites)
foreach($web in $siteColl.AllWebs)
$webUrl = $web.url
$docLibs = $web.Lists | Where-Object {$_.baseType -eq "DocumentLibrary"}
$docLibs | Add-Member -MemberType ScriptProperty -Name WebUrl -Value {$webUrl}
$results += ($docLibs | Select-Object -Property WebUrl, Title, ItemCount)
$results | Export-Csv -Path $OutputFile -NoTypeInformation
Stop-SPAssignment –GlobalYou guys won't believe this ... But, the script actually works as intended if I change the baseType tag to "GenericList"... I had been getting errors (about 14 of them) through PowerShell and
assuming the script didn't process, but after looking at the output CSV, it seems that everything worked properly. I think the 14 errors MAY have been corrupted sites (or something?) as it gives me NullValueNotAllowed when trying to "Add-Member" and points
to $WebUrl as being null.
Next up -- working on getting this script to write specific objects to a SP list! -
Dynamic Texts from Bex ( for Key Figures ) not coming to WEBI Query
Hi Gurus,
We have a Query in BEx : Each Key figure column text changes dynamically - Like based on Present month
it will Display Month +1 Month +2 up to Month +12. Used dynamic Text variables .
But when i created the universe and Webi report , i am missing the text in the column for Key figures .
How should i get the column text in Webi which is same as in Bex : Points will be awarded for helpful
answers.
Thanks
MaggeHi,
text variables with replacement path are supported in BO4.0, see following document: SAP BusinessObjects BI4 - Supported BEx Query Elements
As an example after entering 2012 in the prompts window, the name of the corresponding key figure will dynamically change:
After refreshing and selecting 2013, the column name will update:
Im not sure though if this is the case with unv universe access to BEx queries.
Best regards,
Victor -
I am a .NET developer given the task to extract all table values from all reports on our BOE server - could you please point me in the right direction as to which portion of your BOE API will allow me to:
1. Iterate through all reports on a BOE server
2. Iterate through all table values in a CR Report
If you have any other suggestions or samples on the best way to do this please let me know.
Thank you!Thank you for the references. I can see now how to iterate through the infoobjects:
InfoStore infoStore = (InfoStore) enterpriseSession.GetService("InfoStore");
string queryString = "SELECT SI_NAME, SI_DESCRIPTION "
+ "FROM CI_INFOOBJECTS "
+ "WHERE SI_KIND = 'CrystalReport'";
InfoObjects infoObjects = infoStore.Query( queryString );
IEnumerator infoObjectsEnumer = infoObjects.GetEnumerator();
while(infoObjectsEnumer.MoveNext())
InfoObject crReport = (InfoObject) infoObjectsEnumer.Current;
// iterate through object and extract values
Report report = (Report)crReport;
Can you please tell me what object I will need to cast the info object to in order to access it's table fields? -
Create a Link using Dynamic Text and Capture Variable
I am building a dynamic website using Dreamweaver CS5 with Coldfusion 9
Currently I have created a dynamic text table. The table is created by querying the Invoice table and displays the all the customers Invoices. The columns Include Invoice #, Date, Amount Paid, BalanceRemaining, Due Date. So basically lists all the invoices I have applied to the unique customer. It is pulled up using a session variable I created from the login page.
My question is this I want to make the "Invoice #" linked so when you click on it it goes to a new page and performs a new query which retrieves infro related to that specific invoice such as Services Rendered, Service Description, Date, Price, Total. I was able to create a link to the Invoice # but I am stuck trying to figure out how to capture the Unique Invoice # and apply it to the new query. Is this possible if so how?
Thanks for your help!Now keep in mind I am speaking strictly from a web and SQL standpoint as I have no experience with coldfusion.
If you are able to create the link to the Invoice, I am perceiving this as the following:
Invoice
Links to
#123
page.php?invoice=123
#345
page.php?invoice=345
If your page is setup like that then you already have the data stored in the browser request with the GET method. In PHP the equivalent is the $_GET array. I am assuming ColdFusion has a similar array to work with forms. Then on your following page you obviously need to check that the visitor came from the prior page with the proper permissions to ensure that someone doesn't get the address page.php?invoice=### and just guesses through and views all invoices if they are not supposed to. Then your query would look something like the following:
SELECT * FROM invoice_table WHERE invoice_number = $_GET['invoice']
Remember this in written in PHP so yours should be a similar equivalent.
Hopefully this helps a little to get you going in the right direction. -
Help with delivering dynamic text through an external file, through XML?
I'm struggling to find the best way to deliver dynamic text
from an external file, through XML, to a Flash file.
I use small Flash pieces to deliver multiple sets of content
through a single .swf file. An example is here:
http://www.esi-intl.com/public/government/federal.asp
In the .swf file at the bottom, I'm using a three-scene .fla
file. I'm putting the actionScript in the Actions layer atop each
frame. Example:
stop ();
loadVarsText = new LoadVars();
loadVarsText.load("fedNews.txt");
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
scroller.html=true;
scroller.htmlText = this.var1;
} else {
trace("not loaded");
In that .txt file, I'm putting the information like this:
var1=<font face="tahoma,verdana,sans-serif" size="11px"
color="#000000"><b><a href='
http://www.esi-intl.com/public/classroomtraining/dau.asp'>DAU
Grants ESI Course CON353
Equivalency</a></b><br>Advanced Business Solution
in Contracting (CON 353) is an equivalency for DAU's CON 3535
course, Advanced Business Solutions for Mission Support. <a
href='
http://www.esi-intl.com/public/classroomtraining/dau.asp'><U><font
color="#996633">Continue</font></U></a></font>
So much of this is pick-ups from what I've researched in
Google. I'm looking for a way I can feel more confident in my code,
and also have that code follow CSS.
Lastly, I recognize the problems in XML with using single
quotes / double quotes, and the & symbol. This is one of my
largest time sucks, and I'd like to find a better way to do this.
Thank youHi,
Did you ever find a resolution to this? I'm having a similar
issue that I can't seem to get multiline dynamic text working in
CS3.
The font is embedded but it just displays the first line, and
then a blank. I'm sure this worked fine in Flash MX.
Cheers, Ant
Maybe you are looking for
-
Is there a limit on the number of people you can send an email to? I have a medium sized group, 150+ people, and mail kept failing to send the message because of too many recipients. I was BCCing the group. Is this a mail problem or a yahoo problem (
-
Vector and my object??
hi all, I am reading a binary file, then creating the object and adding that object in my vector. How can i get it back according to its id? let is say i added all the customers read from file and now i want to get customer 3? int thisId=dis.readInt(
-
Material Costing: Moving Average Price Issue
Hi Experts, I have a issue regarding the Moving Average Price of the Material computed by the system (indent sales process): The Material was created with Purchased Price .74PO Price x 10 items = 7.4 Amt in LC Posted into the system (PGR). But afterw
-
Issues with mobile YouTube.
I'm having issues while using YouTube in my safari app. Videos will constantly freeze and not play, while the video time keeps going and buffering. It used to only do this one excessively long videos, but now almost every single video is doing this,r
-
I have a error when i am starting database
ERROR: ORA-01034: ORACLE not available ORA-27102: out of memory SVR4 Error: 12: Not enough space Additional information: 1 Additional information: 202 can someone tell what can i do. database is oracle 9207 unix env 5.8 i have total 3 database in thi